Re: verification of mail success

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

on 02/23/2006 09:22 PM mattias@xxxxxxxxxxxx said the following:
> 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.
> 
> With both mail() and PEAR Mail, an email to an invalid domain (syntactically
> valid) name returned "success"... Running mailq at the command prompt gives me:
> 
> "(Host or domain name not found. Name service error for name=activeagenda.org
> type=MX: Host not found, try again)"
> 
> Basically, I'd like my PHP script to know of issues like these.

What you want is impossible most of the time. The problem is that
usually applications are MUA (Mail User Agents) and so do not deliver
messages. They rather queue them in the MTA (Mail Transfer Agent) queue.
So you only know whether the message was successfully deliver or not if
you request some kind of delivery notification.

Alternatively, if you want to know whether an address is valid, you may
want to try this e-mail validation class.

http://www.phpclasses.org/emailvalidation

You may also want to try this other class that can act partially as an
MTA. It is a normal mail composing and sending class with a SMTP
delivery sub-class that has a direct delivery mode. This means that it
will attempt to send the message directly to the destination SMTP server
rather than queueing in the local MTA queue.

It comes with a wrapper function named urgent_mail(). It is compatible
with the mail function, except that it uses the class direct delivery
mode to attempt to deliver the message right away. If it fails due to
some temporary error, it falls back to the mail() function.

http://www.phpclasses.org/mimemessage

-- 

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux