Re: [PHP] phpmailer send() always return true even the email address is invalid

2009-08-27 Thread Ashley Sheridan
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




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



RE: [PHP] phpmailer send() always return true even the email address is invalid

2009-08-27 Thread Bob McConnell
From: Ashley Sheridan
 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?
 
 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.

The return code only tells you the local server accepted the mail. It is
unlikely that server knows the address is invalid since it can only
validate the domain portion of the address. Only the destination server
can validate the user name, and most are now configured not to report
mail sent to invalid addresses due to spam. They will silently discard
the message.

Bob McConnell

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



Re: [PHP] phpmailer send() always return true even the email address is invalid

2009-08-27 Thread Paul M Foster
On Thu, Aug 27, 2009 at 09:00:24AM -0400, Bob McConnell wrote:

 
 The return code only tells you the local server accepted the mail. It is
 unlikely that server knows the address is invalid since it can only
 validate the domain portion of the address. Only the destination server
 can validate the user name, and most are now configured not to report
 mail sent to invalid addresses due to spam. They will silently discard
 the message.
 

It used to be that internet mail servers would deny an email address as
invalid while the SMTP conversation was going on. Then, because of
services with millions of addresses, like Yahoo, they stopped doing
this, and instead would bounce the messages back some time later.

I recently had a conversation with a guy who's heavily involved in
internet email. His view echoed what you're saying-- it does spammers a
favor to bounce messages to bad addresses. But I got the impression that
his view was a minority one.

It sounds like you're saying his view has become the majority view. Does
your job put you in a position to confirm this with authority?

Paul

-- 
Paul M. Foster

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