email - Remove mailed by in PHP mail using PHPMailer -
i using phpmailer send mail in php program. email working fine showing mailed address in area.how can hide these mailed in phpmailer.and via details email area.
when use php mail() function below removing mailed details.but how can in phpmailer
mail('info@example.com', 'subj', "message", $headers, '-freturn@yourdomain.com')
here php mailer code
<?php require_once 'phpmailer/class.phpmailer.php'; $mail = new phpmailer(true); //defaults using php "mail()"; true param means throw exceptions on errors, need catch $body = "heloooo"; try { $mail->addreplyto('name@yourdomain.com', 'first last'); $mail->addaddress('to@example.com', 'john doe'); $mail->setfrom('info@example.ae', 'info'); $mail->addreplyto('name@yourdomain.com', 'first last'); $mail->subject = 'phpmailer test subject via mail(), advanced'; $mail->altbody = 'to view message, please use html compatible email viewer!'; // optional - msghtml create alternate automatically $mail->msghtml($body); $mail->send(); echo "message sent ok<p></p>\n"; } catch (phpmailerexception $e) { echo $e->errormessage(); //pretty error messages phpmailer } catch (exception $e) { echo $e->getmessage(); //boring error messages else! } ?>
you can remove below 2 lines.
$mail->setfrom('info@example.ae', 'info'); $mail->addreplyto('name@yourdomain.com', 'first last');
then mail details show "root user root@localhost"
. show server sending it.
even use smtp phpmailer, can same.
Comments
Post a Comment