Jump to content

Small Error


pranshu82202

Recommended Posts

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.