Jump to content

How To Create HTML E-mails


xProteuSx

Recommended Posts

I've been using something like this to send email messages to users on a site:

 

                $to = $email;

                $subject = "Message From Microsoft.com\r\n"; 

                $headers = "From: [email protected]\r\n"; 

                $headers .= "Return-Path: [email protected]\r\n";

                $headers .= "Reply-To: [email protected]\r\n"; 

           

                $message = "<html><body><img src='http://www.Microsoft.com/images/logo.png' /><br /><br />You have a message from Bill:<br /><br />";

                $message .= '<img src="' . $image . '" /><br /><br />';

                $message .= 'Isn't it pretty?.<br /><br />';

                $message .= '<a href="http://www.Microsoft.com">Microsoft.com</a></body></html>';

           

                mail($to,$subject,$message,$headers);

 

This sends, literally, text like this:

 

<html><body><img src='http://www.Microsoft.com/images/logo.png' /><br /><br />You have a message from Bill:<br /><br /><img src="http://www.Microsoft.com/images/billiam.jpg" /><br /><br />Isn't it pretty?.<br /><br /><a href="http://www.Microsoft.com">Microsoft.com</a></body></html>

 

Obviously, I would like the email to hide the HTML, but use it to format the output.  Also, I'd obviously like the image to show up, not a link to the image, and I would like the link to show up as a link, not as HTML.

 

How do I do this?  Cheers.

Link to comment
https://forums.phpfreaks.com/topic/254775-how-to-create-html-e-mails/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.