0

This is on bluehost - I have tried sending to other clients aside from gmail and I still get the same issue: all of my html is appearing as plaintext / tags. Not getting rendered into html.

    $to = '###@gmail.com';

    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $headers .= "From: $from \r\n";


    $headers = array(

    'From' => "###@####.com",

    'Cc' => "####@gmail.com",

    'Subject' => "Your Reminder From Remindmeto.org",

    );



    $body = '<html><body>';
    $body .= '<h1>From the mists of memory I speak...</h1>';
    $body .= "$image";
    $body .= '</body></html>';



    $mail = Mail::factory("mail");

    $mail->send($to, $headers, $body);
  • What does the message source of the message you receive look like? The answer will be in there. – Michael Berkowski Sep 02 '12 at 23:59
  • Also, I notice that you are building a string of headers with `\r\n`, but then redeclaring your headers as an array. Which one does your `Mail::factory()` expect? If it expects a string but you're ultimately giving it an array, that is your problem. – Michael Berkowski Sep 03 '12 at 00:02
  • possible duplicate of [Sending HTML email from PHP](http://stackoverflow.com/questions/3058897/sending-html-email-from-php) – mario Sep 03 '12 at 00:26
  • possible duplicate of [how to send html mails using PEAR mail](http://stackoverflow.com/questions/1361762/how-to-send-html-mails-using-pear-mail) – mario Sep 03 '12 at 00:28

1 Answers1

0

You are setting your headers twice. Change to this:

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: $from \r\n";
$headers .= "Cc: ####@gmail.com \r\n";
$headers .= "Subject: Your Reminder From Remindmeto.org \r\n";

And get rid of the array part :)

zenkaty
  • 1,538
  • 9
  • 11