0

Let's take example that I have three Email addresses.

-testing1@gmail.com

-testing2@gmail.com

-testing3@gmail.com

I want to set reply to field to testing3@gmail.com always. If i send an email from testing1@gmail.com to testing2@gmail.com then it's working.

But If send an email from testing1@gmail.com to testing1@gmail.com and set reply to field to testing3@gmail.com then it's not working.

In an popup it shows reply to as testing3@gmail.com.But If I press on reply button it automatically changes to testing1@gmail.com.

I don't know why this is happening. has this happened with anyone before ?

EDIT

Actually this is just a problem of Gmail. In Gmail it doesn't work but it works in yahoo and hotmail. I don't know that is this a bug of Gmail or they have designed it this way.

Edit 2

 $mail = new PHPMailer;

    $mail->IsSMTP();                                      // Set mailer to use SMTP
    $mail->Host = 'smtp.gmail.com';                       // Specify main and backup server
    $mail->SMTPAuth = true;                               // Enable SMTP authentication
    $mail->Username = 'test1';                     // SMTP username
    $mail->Password = 'PASSWORD';                         // SMTP password
    $mail->SMTPSecure = 'tls';                            // Enable encryption, 'ssl' also accepted

    $mail->From = ''test1@gmail.com";
    $mail->AddAddress('test1@gmail.com', $name);  // Add a recipient

    $mail->AddReplyTo('list123@gamil.com', 'List manager');

    $mail->WordWrap = 50;                                 // Set word wrap to 50 characters

    $mail->IsHTML(true);                                  // Set email format to HTML

    $message = "Hi  Hello" ;


    $mail->Subject = 'Subject;
    $mail->Body    = $message;

    $mail->Send();

Note

I am giving same address in sender and receiver both. But giving different replyTo.

keen
  • 3,001
  • 4
  • 34
  • 59
  • possible duplicate of [GMail appearing to ignore Reply-To](http://stackoverflow.com/questions/2421234/gmail-appearing-to-ignore-reply-to) – Jk1 Feb 12 '14 at 03:06
  • Thanks.But I couldn't figure out the solution for this. Can you please point to the right direction ? – keen Feb 12 '14 at 10:12

1 Answers1

0

If you use smtp.gmail.com to send a message, and the sender's email address is not yourgoogleemailname@gmail.com, then Gmail will rewrite the headers and set the from address to yourgoogleemailname@gmail.com. See http://lifehacker.com/111166/how-to-use-gmail-as-your-smtp-server for more info, and for a possible solution.

mti2935
  • 11,465
  • 3
  • 29
  • 33
  • See i updated my question with a script that i am using to send an email. But how i can check off "tsl" secure connection ? – keen Feb 14 '14 at 05:14
  • You need to use port 465, and you need to use ssl, not tls. See http://www.web-development-blog.com/archives/send-e-mail-messages-via-smtp-with-phpmailer-and-gmail/. – mti2935 Feb 14 '14 at 05:52
  • I tried that but no effect. But even if specified replyTo to list123@gmail.com it automatically takes test1@gmail.com as a replyTo. – keen Feb 14 '14 at 05:58
  • even it displays list123@gmail.com when i click on a drop down button to see email information. when i click on reply it takes test1@gmail.com – keen Feb 14 '14 at 06:00
  • which address (list123@gmail.com or test1@gmail.com) is associated with the smtp username and password that you are using to authenticate? – mti2935 Feb 14 '14 at 11:34
  • No it's different email address. Take a example it's user's email, So if user is contacting me. I am sending an email from my account to my account and reply to should go to user's account. So I am assigning user's address as reply to. – keen Feb 14 '14 at 11:37
  • That's your problem. As I mentioned above, gmail will rewrite the headers and set the FROM address (and/or possibly the reply-to address) to the address associated with the smtp username and password that you are using to authenticate. See http://lifehacker.com/111166/how-to-use-gmail-as-your-smtp-server for more info, and for a possible solution. – mti2935 Feb 14 '14 at 13:24
  • Another work around would simply to use a different SMTP host, other than gmail. http://www.ultrasmtp.com is one option - they also offer a number of features for tracking and delivery confirmation. – mti2935 Feb 14 '14 at 16:04
  • I know that this is my problem. By the way i checked this link before I couldn't find anything useful for this scenario. – keen Feb 15 '14 at 04:38
  • UltraSMTP take charges of it's services. – keen Feb 15 '14 at 04:41