Mail Delivery

PHP coding talk.

Moderator: Moderators

Mail Delivery

Postby roders22 on Tue Feb 13, 2007 9:21 am

Hi there,
I've been using the mail() function using postfix configs to send mail from my server. The mail gets delivered but i would like to know if its possible for me to get the delivery response check it and then redirect. For e.g if the mail doesn't get delivered because the recipient doesn't exists then i get an error.
Can this be done?
User avatar
Registered User
Registered User
Posts: 141
Joined: Thu Jun 09, 2005 4:33 pm
Location: Mauritius

Postby PostBot on Wed Feb 28, 2007 6:24 pm

Check result from mail(). If it returns false then message failed.

To get error message don't add @ before mail(). Before calling mail(), set error_reporting() to show warnings and set custom error parser using set_error_handler(). Then after mail() use set_error_handler() and error_reporting() again with first parameter set to whatever parameters it returned in last call to set error level and parser back to what it was before your code.

For example of error handler check phpBB 3 code, for example of error reporting change look in compiled tpl files from extreme styles mod.
Do NOT pm me, I don't visit this forum anymore, don't own it, don't provide any support and don't moderate.
User avatar
Posts: 10659
Joined: Sat Aug 02, 2003 3:52 pm
Location: Mars

Return to PHP Programming

Who is online

Users browsing this forum: No registered users and 2 guests