[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 333
  • Last Modified:

bounce header for PHP mail script

Hello All,
I have a script that sends email (Sendmail), but I would like the bounces to go a particular mailbox.  What is the header that I use to do this?  I thought it might be Return-Path, but this didn't seem to work for me.  If you have something that works, feel free to post the code.  If you could provide me with a link to the location on the sendmail site that gives a listing of headers and what they do, that would be great.

Thanks,

Tom
0
tom419
Asked:
tom419
1 Solution
 
ykf2000Commented:
HI

try editing your php.ini file and change the sendmail command line to

sendmail -t -f thebouncemail@yourdomain.com
0
 
CurieuxCommented:
Hi,

Perhaps you want only this script to use a particular bounce address. So it wouldn't be a good idea to fix it in the php.ini.
I suggest doing this:

$mail_header  = "FROM: $your_email \n";
$mail_header .= "REPLY-TO: $bounce_email \n";


mail($receiver_email,$subject,$mail_text,$mail_header);

Regards
0
 
CurieuxCommented:
Oops a little mistake in my code above:

$mail_header  = "FROM: $your_email \n";
$mail_header .= "REPLY-TO: $return_email \n";
$mail_header .= "RETURN-PATH: $bounce_email \n";

mail($receiver_email,$subject,$mail_text,$mail_header);

;)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
higijjCommented:
What's the bounce email for?

the REPLY-TO I got it.. but RETURN-PATH ?
0
 
tom419Author Commented:
The idea being that if a message is sent to an invalid address or some other problem that causes it to be returned, I want it to be returned to a particular address.  True, I could just send the message with the 'bounced email' address as the From address, but then people couldn't just reply to the email.

Curieux: I thought I tried this once before, but I'll try your code and do it again.  I figured RETURN-PATH was it for me, but it just didn't seem to work last time.

Thank you everyone for your help.

Tom
0
 
CurieuxCommented:
Tom419 here's the page on sendmail.org for the headers:
http://www.sendmail.org/rfc/0822.html

Good luck :o

Curieux
0
 
tom419Author Commented:
Curieux:
This worked for me after all!  And thanks for the link to the Sendmail headers.  I appreciate your help.

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now