ecabrera Posted August 4, 2012 Share Posted August 4, 2012 hey i dont why this wont work i can do h1 tags $to = "koslr@ymail.com"; $email = $_POST['email']; $subject = $_POST['subject']; $message = "<h1>MY IMAGE OF A LOGO</h1>"; $message .= $_POST['message']; $header = "From: $email"; Quote Link to comment https://forums.phpfreaks.com/topic/266690-html-email/ Share on other sites More sharing options...
Pikachu2000 Posted August 4, 2012 Share Posted August 4, 2012 Example #4 in the PHP manual shows how to send HTML mail: mail Quote Link to comment https://forums.phpfreaks.com/topic/266690-html-email/#findComment-1366862 Share on other sites More sharing options...
ecabrera Posted August 4, 2012 Author Share Posted August 4, 2012 ok so i check it out and instead of sending it in html it just send it like if it was normal text Quote Link to comment https://forums.phpfreaks.com/topic/266690-html-email/#findComment-1366863 Share on other sites More sharing options...
Pikachu2000 Posted August 4, 2012 Share Posted August 4, 2012 Post the problematic code. Quote Link to comment https://forums.phpfreaks.com/topic/266690-html-email/#findComment-1366864 Share on other sites More sharing options...
ecabrera Posted August 4, 2012 Author Share Posted August 4, 2012 <?php $msg = ""; $to = "koslr@ymail.com"; $email = $_POST['email']; $subject = $_POST['subject']; //$message = $_POST['message']; $message = '<h1>TEST</h1>'; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "From: $email"; if(isset($_POST['submitbtn'])){ if($email){ if($subject){ if($message){ mail($to,$subject,$message,$headers); $msg = "<font color='green'>Message Sent</font>"; }else $msg = "Enter a message"; }else $msg = "Enter a subject"; }else $msg = "Enter your email"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/266690-html-email/#findComment-1366865 Share on other sites More sharing options...
jazzman1 Posted August 5, 2012 Share Posted August 5, 2012 Your script works to me: Try this: $to = "tuparov86@gmail.com"; $email = 'jazzman@jazzman.ca'; $subject = 'Post message'; $message = ' <html> <head> <title>Birthday Reminders for August</title> </head> <body> <p>Here are the birthdays upcoming in August!</p> <table> <tr> <th>Person</th><th>Day</th><th>Month</th><th>Year</th> </tr> <tr> <td>Joe</td><td>3rd</td><td>August</td><td>1970</td> </tr> <tr> <td>Sally</td><td>17th</td><td>August</td><td>1973</td> </tr> </table> </body> </html> '; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "From: ".$email; if(mail($to,$subject,$message,$headers)){ echo 'Message sent'; exit; } else { echo "Error...."; exit; } Quote Link to comment https://forums.phpfreaks.com/topic/266690-html-email/#findComment-1366870 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.