Phmailer gmail "out" is a gmail account

I am trying to send mail with PHPmailer and gmail. But when I send mail from my gmail account, and not without reply. How to set no-reply as?

The code I have is:

$mail = new PHPMailer();  

$mail->Mailer = "smtp";
$mail->Host = "ssl://smtp.gmail.com";
$mail->Port = 465;
$mail->SMTPAuth = true; 
$mail->Username = "myAccount@web.com"; 
$mail->Password = "password"; 

$mail->From     = "no-reply@web.com";
$mail->AddAddress($to);  
$mail->AddReplyTo("no-reply@web.com","no-reply");

$mail->Subject  = $subject;
$mail->Body     = $msg;
$mail->WordWrap = 150; 
$mail->send();

Received mail (headers):

Return-Path: <myAccount@web.com>

Which should be no-reply@web.com

Thanks in advance

+3
source share
2 answers

You cannot do this. Imagine that you sent a request by mail to respond with your bank account credentials from an address validation@yourbank.com.

In order to receive an unanswered address, you must have access to the mail server in @your.domain(not gmail) and create such an account there, and then send emails using this account.

+2

, :

  • Google Apps myaccount@web.com, "", " ", " " , no-reply@web.com . , no-reply@web.com, no-reply@web.com myaccount@web.com.

  • Google Apps no-reply@web.com . myaccount@web.com , BCC no-reply@web.com myaccount@web.com.

+5

All Articles