Basic text emails can be dull and not very imaginative, so if you want to have a good looking newsletter or any email you need to use html in the message. However some people think you just change your normal text message to html, and then they wonder why it displays the html code when they look in their inbox, the reason for this is that the content type is set to plain text you need to set it to html which is easily done with the header() function.
<?php /* Once again we specify the variables message and who the email is from and who the email is to as well as the subject. Notice in the headers that I have added content-type: text/html which makes sure the html is processed as html not just printed out in the email */ $message = "<html><head></head><body bgcolor='#EEEEEE'>"; $message .= "<p align='center'>This is my first html email</p>"; $message .= "</body></html>"; $from = "someone@domain.com"; $to = "someone@anotherdomain.com"; $subject = "Simple Text Email"; $headers = "From: $from"; $headers .= "Content-type: text/html\r\n"; /* Now we are ready to send the email so we call php's mail() function With the appropriate variables from above included in the brackets */ mail($to,$subject,$message,$headers); ?>