I am emailing a field from a MySQL DB table. The field type is text. Basically, it is an accept email. How can I make it so the email sent is capable of emailing HTML to make the message more attractive? I have already tried to insert < html > into the text field, but that doesn't work....The received email, just diplays the text < html > and then the rest of the text. ANy suggestions?
Try this: (if you are using PHP) $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: Your Name <youremail@yourdomain.com>' ."\r\n" .'Reply-To: youremail@yourdomain.com' ."\r\n" .'X-Mailer: PHP' ."\r\n"; $subject = 'Subject'; $body = 'The HTML text from DB'; $email = 'someemail@somedomain.com'; mail($email, $subject, $body, $headers); PHP:
You need to send the HTML mime type along with the email so the email client knows the message is HTML.