RE: Behavior of mail() function

Venkat Raman Don <[email protected]>
Newsgroups gmane.comp.php.windows
Message-ID <3FA2AD39E9964240B4E6DD4AE62E031B55273D31@TK5EX14MBXC118.redmond.corp.microsoft.com>
You can use PHP exception to handle it and the script will not die. Details at http://php.net/manual/en/language.exceptions.php.

Thanks,
Don.

-----Original Message-----
From: Lewis Kapell [mailto:[email protected]] 
Sent: Monday, April 19, 2010 12:22 PM
To: [email protected]
Subject: [PHP-WIN] Behavior of mail() function

Running PHP version 5.3.1, I find that if my script tries to send an email message to an address in the local domain, and the address is invalid, mail() throws an error:

mail(): SMTP server response: 550 5.1.1 <[email protected]>: 
Recipient address rejected: User unknown in local recipient table

Is there a way I can configure PHP so that mail() would return false in this case, rather than throwing an error which causes the script to die?

Our mail server is a Linux server running Postfix, if that matters.

Thank you
Lewis Kapell


--
PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.