Not receiving bouncebacks using PHP mail() function

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

mail("", "test", "hi", "From:");

as the address does not exist I would expect to get a bounceback to - instead it sends the delivery notification to the account - if I telnet to the SMTP server port 25 and do a manual message:

mail from:
rcpt to:



i get a bounceback to fine so it appears to be the php function

can anyone assist me with this please?
Question by:rgtechnologies
    LVL 7

    Accepted Solution

    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

    The from field in the mail command does not actually set the from header properly use as the additional_parameters parameter, i.e. the fifth parameter

    mail("", "test", "hi", "From:", "");#

    See if that works

    Author Comment

    nope still no luck
    LVL 7

    Expert Comment

    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.


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

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now