Re: verification of mail success
| From: | Chris | Date: | Fri, 24 Feb 2006 00:44:19 +0000 |
| Subject: | Re: verification of mail success | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-230994@lists.php.net to get a copy of this message | ||
mattias@thorslund.us wrote:
Hi, This might be "too simple" or not... I'm trying to send emails from my PHP page, and while both mail() and PEAR Mail work, I'm having a hard time finding out whether a message was actually sent or not.The short answer is 'not really'. The long answer.. If the mail server accepts the mail, then the php mail() command returns true. If it doesn't accept it (eg it's down), then it returns false. Since (in this case) your mail server accepts the email to attempt delivery and places it in the queue, mail() returns true. Whether it works after that is up to the mail server to figure out. You could try to send emails through an smtp server but I don't think this would give you any extra benefits and it's a lot harder because you have to check at each step that the command works.. I don't know if pear mail can handle this for you. -- Postgresql & php tutorials http://www.designmagick.com/