pranshu82202 Posted August 20, 2011 Share Posted August 20, 2011 i am using a php mail scriot which is perfectly sending emails... <?php require("class.phpmailer.php"); // path to the PHPMailer class $to=$_POST['email']; $msg='<html> <body><h1>My HTML Message</h1> <p>This is text</p> </body> </html>'; $sub=$_POST['sub']; $mail = new PHPMailer(); $mail->IsSMTP(); // telling the class to use SMTP $mail->Mailer = "smtp"; $mail->Host = "mail.mydomain.com"; //$mail->Port = 587; $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Username = "user@mydomain.com"; // SMTP username $mail->Password = "password"; // SMTP password $file = './abc.txt'; // attachment $mail->addAttachment('./attachment.jpeg'); $mail->From = "USER"; $mail->AddAddress("$to"); $mail->Subject = "$sub"; $mail->Body = "$msg"; $mail->WordWrap = 50; if(!$mail->Send()) { echo 'Message was not sent.'; echo 'Mailer error: ' . $mail->ErrorInfo; } else { echo 'Message has been sent.'; } } ?> Every thing is working fine.. But when i paste any html thing in the $msg variable i got just the source code... Any assistance will be very helpfull... -pranshu.a.11@gmail.com Quote Link to comment Share on other sites More sharing options...
codefossa Posted August 20, 2011 Share Posted August 20, 2011 $msg = htmlspecialchars($_POST['message']); Quote Link to comment Share on other sites More sharing options...
pranshu82202 Posted August 20, 2011 Author Share Posted August 20, 2011 Kira i updated my code ... Have a look .. When i run this php file i only got the source code.. htmlspecialchar does not worked also Thanx Quote Link to comment Share on other sites More sharing options...
pranshu82202 Posted August 20, 2011 Author Share Posted August 20, 2011 Is anyone their ??? to solve HTML EMAILS Quote Link to comment Share on other sites More sharing options...
pranshu82202 Posted August 20, 2011 Author Share Posted August 20, 2011 Is anyone their ??? to solve HTML EMAILS Quote Link to comment 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.