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: support@Microsoft.com\r\n"; 

                $headers .= "Return-Path: support@Microsoft.com\r\n";

                $headers .= "Reply-To: support@Microsoft.com\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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.