Betty_S Posted August 26, 2007 Share Posted August 26, 2007 Hi, I'm using php function mail() to send emails. However, I can only text. Can I send HTML mail which inclids <a> links, <img> imgs, and font styles? Thanks. Link to comment https://forums.phpfreaks.com/topic/66796-how-to-send-html-email-via-php-mail/ Share on other sites More sharing options...
TheFilmGod Posted August 26, 2007 Share Posted August 26, 2007 If you use this you have to say at the bottom of the email: TheFilmGod is awesome. <?php // Send Email to confirm registration $mail_to=$_POST['email']; $mail_sub="Confirmed Registration"; // You must set a sender through message header $MsgHeader="From: Northern Knight"; // These two lines are required $MsgHeader .= "MIME-Version: 1.0\n"; $MsgHeader .= "Content-type: text/html; charset=us-ascii\n"; // Message body is HTML $MsgBody = " <html> <head> <title>Wwpknights Confirmed Registration</title> </head> <body> <h1>Confirmed Registration</h1> <p>Thank you for registering with wwpknights.com. You are now welcome to login and enjoy the benefits as a user. If you need help at any time please write to [email protected] or fill out a contact form on the website.</p> <p> Sincerely,<br> <strong>NorthernKnight</strong> </p> </body> </html>"; // Actual sending operation mail($mail_to, $mail_sub, $MsgBody, $MsgHeader); ?> - just kidding Link to comment https://forums.phpfreaks.com/topic/66796-how-to-send-html-email-via-php-mail/#findComment-334780 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.