mail() inquiry:

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
harrisonad
Forum Contributor
Posts: 288
Joined: Fri Oct 15, 2004 4:58 am
Location: Philippines
Contact:

mail() inquiry:

Post by harrisonad »

Will mail() function execute properly even if the receipient doesn't exists.
for example:

Code: Select all

$receipient = "somebody@somewhere.orgy";
$subject = "Got you!";
$message = "I knew you can't detect false receipients.";
mail($receipient,$subject,$message);
you have any suggestions?
User avatar
harrisonad
Forum Contributor
Posts: 288
Joined: Fri Oct 15, 2004 4:58 am
Location: Philippines
Contact:

re

Post by harrisonad »

I got this from mail() function documentation

Returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise.

It is important to note that just because the mail was accepted for delivery, it does NOT mean the mail will actually reach the intended destination.
which means that testing for the return value of mail() function such as:

Code: Select all

if(mail($receipient,$subject,$message)){
// do stuff..
}
... will not tell us that the receipient's email address exists.

anyone here has a better approach?
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

a little websearch for "php e-mail validation" returned for example this:

http://www.zend.com/zend/spotlight/ev12apr.php
Post Reply