Home Email My Account

How can I get emails that bounce, when using the PHP mail() function

When sending email messages using PHP, you must set the envelope sender in order to have bounces handled correctly. In order to set the envelope sender, use the -f sendmail option in the additional_parameters parameter of the mail command. Here is an example:

mail("to@example.com", "subject", "body of message", "From: sender@example.com", "-fsender@example.com");

Without the last parameter, "-fsender@example.com", bounces would come back to a system administrator account, instead of the From address, which is usually not what is intended.

Last Updated: April 11, 2023

Comments

First Name:*
Last Name:*
Email:*
Comment:
Rating:

Domain Registration

Hosting

Website Builder

Web Design

SSL Certificates

Website Security

Microsoft 365

SEO

Email Marketing

Contact Support

WHOIS

© 2025 Fagan Media