Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Not receiving bouncebacks using PHP mail() function

Posted on 2006-03-22
Medium Priority
Last Modified: 2013-12-12
im attempting to send mail via the php function in the following format:

mail("xyz@zyx.com", "test", "hi", "From: me@me.com");

as the address xyz@zyx.com does not exist I would expect to get a bounceback to me@me.com - instead it sends the delivery notification to the account apache@domain.com.au - if I telnet to the SMTP server port 25 and do a manual message:

mail from: me@me.com
rcpt to: xyz@zyx.com



i get a bounceback to me@me.com fine so it appears to be the php function

can anyone assist me with this please?
Question by:rgtechnologies
  • 2

Accepted Solution

Lhotch earned 750 total points
ID: 16272904
When using the mail() function the user apache is the one sending the mail and thus the user who gets the bounceback notification. Your could try adding for complete header information but what I would actually recommend is utilizing something like the phpmailer class.


Expert Comment

ID: 16282306
The from field in the mail command does not actually set the from header properly use -fme@me.com as the additional_parameters parameter, i.e. the fifth parameter

mail("xyz@zyx.com", "test", "hi", "From: me@me.com", "-fme@me.com");#

See if that works

Author Comment

ID: 16286126
nope still no luck

Expert Comment

ID: 16314441
rgtechnologies , you may also want to try setting a return path and also the X-Mailer. Id recommend building a variable that contains all the optional headers and make sure each additional header is followed by a newline and carriage return.

"Reply-To: me@me.com"

'X-Mailer: AT&T Message Center Version 1 (Aug  4 2005)'

Perhaps try setting the X-mailer as something you know doesnt get filtered.

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question