Ash, Viktor, Thanks!
Yes, validate the email is the preliminary solution. However, it is still possible that the email address is valid but is not exist in the target email provider.
I wish to know also if the email can reach the recipient or not.
Actually, I have tested with localhost in my computer, with ArGoSoft Mail Server, I'm just using php mail() function. When the email server was off, or invalid email account of localhost, or sending to external email provider (which I have yet to configured the DNS, so ArGoSoft cannot resolve it), I'll receive false from the mail() function. I need to use this info to inform my user whether the mail is successfully sent out or not.
Any idea why PHP mail() function can do this in my computer?
Thanks for your valuable advice!


"Viktor Popov" <vpo...@neterra.net> wrote in message news:4a9682af.7050...@neterra.net...
Ashley Sheridan wrote:
On Thu, 2009-08-27 at 20:38 +0800, Keith wrote:
Due to my web hosting server implement SMTP authentication, I couldn't do it with PHP mail() function, so I opt for PHPMailer. However, the $mail->Send() method always return true even I've set the $mail->AddAddress with invalid email address.
I've tried with valid address. It's good and I've received the email.
Then I set it with invalid x...@gmail.com, the return value is true, and I have received email from mailer daemon that gmail has rejected the email. Then I set the $mail->Address with invalid name & invalid domain. This time, the $mail->Send() still return as true, however, I didn't receive email from mailer daemon this time.

Any idea why this happened? Any solution for me or suggestion to use other send mail class/function that support SMTP authentication?

Thanks!
Keith

The return code only informs you that the mail was sent successfully,
not that it was received, so you can have invalid email addresses and
still have the function return true.

Thanks,
Ash
http://www.ashleysheridan.co.uk



Exactly, you should validate the e-mail addresses before sending the mail.

Something like this:

http://php.dzone.com/news/php-email-validator-email-mx-d


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

Reply via email to