Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sending HTML code in E-Mail Put some HTML in the message. An example would be: Hello World! Prepare for our arrival. We are starving!!! When you have entered.

Similar presentations


Presentation on theme: "Sending HTML code in E-Mail Put some HTML in the message. An example would be: Hello World! Prepare for our arrival. We are starving!!! When you have entered."— Presentation transcript:

1 Sending HTML code in E-Mail Put some HTML in the message. An example would be: Hello World! Prepare for our arrival. We are starving!!! When you have entered all relevant data in the form, click the Send button, and check your e- mail. It will display with out the effects of your HTML: To Make HTML code run in your message we need to add some more headers.

2 Sending HTML by using Headers

3 Multipart Messages

4

5 How it Works This tells the e-mail client to look for additional “Content-type” information in the message, which includes boundary information. The boundary is what separates the multiple parts of the message. It begins with two dashes (--), and goes at the beginning of the message, between each part, and at the end. The HTML portion of our e-mail follows. Note the double dashes (--) in front of the boundary. Also note the use of two new lines (\n\n) on the Content- Transfer-Encoding line. Do not neglect those— the code will not work correctly without them. $message.= “--$boundary\n”; $message.= “Content-type: text/html; charset=iso-8859-1\n”; $message.= “Content-Transfer-Encoding: 7bit\n\n”; $message.= $messagebody. “\n”; $headers.= “Content-type: multipart/alternative; boundary=\”$boundary\”\r\n”;

6 Next is the text portion of our e-mail. Note the similarity to the HTML portion. You do not need to include the same $messagebody here. In fact, you would usually include an alternate message in text format. $message.= “--$boundary\n”; $message.= “Content-Type: text/plain; charset=\”iso-8859-1\”\n”; $message.= “Content-Transfer-Encoding: 7bit\n\n”; $message.= $messagebody. “\n”; This is the final boundary. Note the double dashes (--) at the end. This signifies that it’s the end of the e-mail. $message.= “--$boundary--”; This is used to set the boundary in our example $boundary = “==MP_Bound_xyccr948x==”;


Download ppt "Sending HTML code in E-Mail Put some HTML in the message. An example would be: Hello World! Prepare for our arrival. We are starving!!! When you have entered."

Similar presentations


Ads by Google