Problems sending html email in php -


I am trying to send an email that has layout and images. Am I doing wrong?

  & lt ;? Php $ message = $ _POST ['message']; $ Emailbject = 'site.com'; $ WebMaster = 'email@site.com'; $ Body = "& lt; html> body bgcolor = \" e7e7e7 \ "style style = \" text / css \ "& gt; #body {margin: auto; range: 0; padding : 0; Font -Fillily: Georgia, Times New Roman ', Times, Serif; font-size: 12px;} #Millle header {width: 500px; height: 131px; background: url (http://www.site .com / images / image .gif) no-repeat;} # email content {width: 500px; background: url (http://www.site.com/images/image2.gif) repeat-y; text-alignment : Left; padding: 0 33px 0 6px;} #emailFooter {width: 500px; height: 34px; background: Y RL (http://www.site.com/images/image3.gif) no-repeat;} & lt; / style & gt; & lt; table width = \ \ "Cent; & Lt; Table width = \ "500 \" limit = \ "0 \" cellpadding = \ "0 \" cellpadding = \ "0 \" & gt; & Lt; Tr & gt; & Lt; TD ID = \ "Email Header \" & gt; & Lt; / Td> & Lt; / Tr & gt; & Lt; Tr & gt; & Lt; Td id = \ "email content \" & gt; Content $ message & lt; / Td> & Lt; / Tr & gt; & Lt; Tr & gt; & Lt; Td id = \ "emailFooter \" & gt; & Lt; / TD and G; & Lt; / TR & gt; & Lt; / Table & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt; & Lt; / Body & gt; & Quot; $ Headers = "Content-type: text / html \ r \ n"; $ Success = mail ($ webmaster, $ email box, $ body, $ header); If ($ success) {echo "your message was sent".}; {Echo "was an error.";}? & Gt;  

You should use PHP instead of mail () - function. This allows you to easily send HTML-mails.

In addition to this you can try to be compatible to email your HTML-code.

All the best, Fabian


Comments

Popular posts from this blog

MVP, design question -

excel - Populate list via a bi-Condition -

iphone - How do I make a UIPickerView in a UIActionSheet -