This is a discussion on What are the header contents to be sent in the php mail function... within the PHP Programming forums, part of the Web Development category; What are the header contents to be sent in the php mail function to differentiate between a text mail and ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| What are the header contents to be sent in the php mail function to differentiate between a text mail and html mail..! The Normal mail function in php is the mail($to,$subject,$message,$headers); Common Header Part ================== $headers = "From: Our Company <company@ourcompany.com>\n"; $headers .= "Reply-To: Our Company <company@ourcompany.com>\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: multipart/alternative; boundary=\"$mime_boundary\"\n"; so if we want to send a text mails we need to send the $header content as .. $message = "--$mime_boundary\n"; $message .= "Content-Type: text/plain; charset=UTF-8\n"; $message .= "Content-Transfer-Encoding: 8bit\n\n"; and while in case of sending HTML mails $message .= "--$mime_boundary\n"; $message .= "Content-Type: text/html; charset=UTF-8\n"; $message .= "Content-Transfer-Encoding: 8bit\n\n"; |
| Sponsored Links |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Help] Script to get contents of a function from other file | rajkumar | PHP Programming | 0 | 11-15-2007 06:23 AM |
| HTML format and attachment in the mail function are work in gmail but not in yahoo | Vani Sri | PHP Programming | 0 | 10-18-2007 02:48 AM |
| How do I stop spammers using header injection with my PHP Scripts? | itbarota | PHP Programming | 0 | 09-11-2007 12:11 AM |
| mail function | vijayanand | PHP Programming | 2 | 08-03-2007 12:55 AM |
| Mail header | P.Sathiya | PHP Programming | 1 | 07-20-2007 07:36 AM |