简体   繁体   中英

How can the email sender reply address say “do not reply”?

Today I registered myself on Pinterest.com with my Yahoo account. After registration I got an email for email validation, at the bottom of the email this message was showed by Yahoo:

Sender reply address says do not reply

and I could also hide this message, I mean it was not in the body of email.

Here is screenshot of my email: http://imgur.com/ke95B

My question is:

How can I use this option when I use 'PHP PEAR' or default mail() function?

yahoo parses the reply-to header. set a header like this:

Reply-To: noreply@example.com

replace example.com with your sender domain.

it should work with either mail() (see example by Zac) or Pear

[....]
$headers["Reply-To"]="noreply@example.com";
$mail_object->send($recipients, $headers, $body); 

no-reply instead of noreply works as well. Your email from pinterest.com for example has a header Reply-To: no-reply@pinterest.com

Using standard mail() simple example as follows:

$headers = array(
        'From: No reply',
        'Content-Type: text/html'
        );

        $subject = "This is a subject";
        $message = 'Some email message goes in here';

        $to = 'someone@example.com';

        mail($to,$subject,$message,implode("\r\n",$headers));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM