czarodziej
New Member
I have a code with I'm using to send PHP emails to my recipients. I have found a way to send them a HTML email by including the 'Content-Type' => "text/html" in the header's section. My question is that how will those receive my email, who can't display HTML emails? They will see the HTML code? If so, than how can my mailer application decide, when to send the Plain and when to send the HTML formation?Here is my code for instance:\[code\]<?php require_once "Mail.php"; $from = "Example <[email protected]>"; $to = "[email protected]"; $subject = "Hi!"; $body = '<html>This is a HTML message...</html>' $host = "smtp"; $username = "user"; $password = "pass"; $headers = array ('From' => $from, 'To' => $to, 'Content-Type' => "text/html", 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { echo("<p>" . $mail->getMessage() . "</p>"); } else { echo("<p>Message successfully sent!</p>"); } ?>\[/code\]