Question:
How can I send an HTML formatted e-mail?
?
2009-11-10 10:19:22 UTC
I.e. Change content type using PHP? Where do I declare the content as HTML?
Three answers:
2009-11-10 10:42:50 UTC
You will need to use an external library such as PHPMailer. This is pretty simple, because you just include a php file then use their functions for sending an email instead of the default mail function.



Here is an example of what you might use.



require_once("/your/path/phpmailer/class.phpmailer.php");



$mail = new PHPMailer();

$mail->From = "your@address.com";

$mail->FromName = "Your Name";

$mail->Host = "localhost";

$mail->Mailer = "mail";

$mail->Subject = "Here is your HTML email!";

$mail->Sender = "Your Company"



$html_body = null;

$html_body = urldecode('

Sweet!

');



$mail->IsHTML(true);

$mail->Body = $html_body;

$mail->AddAddress('recipient@address.com');

$mailed = @$mail->Send();
?
2016-10-16 15:42:36 UTC
something ought to artwork to deliver HTML attachments, in case you mean bulk mail. in case you prefer to have inline pictures that are links to different attachments no longer on line URLs you decide on utility that is conscious a thank you to try this. Thunderbird is circulate-platform and can deliver everyday HTML mail; uncertain with reference to the image factor.
2009-11-10 10:29:34 UTC
You no need to specify your content as a HTML anywhere.It will automatically convert into content.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...