Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Problem in sending mail

by karthigayan (Initiate)
on Nov 09, 2009 at 06:27 UTC ( #805860=perlquestion: print w/ replies, xml ) Need Help??
karthigayan has asked for the wisdom of the Perl Monks concerning the following question:

Hi all, To send mail using perl I used the modules Email::Send,Email::Send::Gmail and Email::Simple.Mails were sent as I expect.But I couldn't identify the non existing mail ids. For example, fefsdfdsf@gmail.com Is there is any way,please help. Thanks .

Comment on Problem in sending mail
Re: Problem in sending mail
by chromatic (Archbishop) on Nov 09, 2009 at 09:26 UTC

    The only way you can know if an address is valid is if the recipient confirms that it is valid. Otherwise, you have to check that the domain exists, accepts mail, and does not reject or bounce the message. There is no general purpose way to do so without attempting to send the message. Even then the server may not bounce the message to thwart dictionary spamming attacks.

Re: Problem in sending mail
by arun_kom (Monk) on Nov 09, 2009 at 09:27 UTC

    Perhaps the mail id 'fefsdfdsf@gmail.com' exists and the mail is successfully sent to that address though it wasnt your intention ... unless of course your intention was spamming ;) ... So, it is important to first check for accuracy of your send list addresses ... and then you can check for a successful sending of the mail to the correct address using the code below which is given in the synopsis of the module you mentioned.

    eval { $sender->send($email) }; die "Error sending email: $@" if $@;
Re: Problem in sending mail
by irah (Pilgrim) on Nov 09, 2009 at 10:37 UTC

    The one another way is, you can specify the reply-to parameter in the argument. So if the server could not find the mail id, it will return the error message (Undeliverable or bounce mail) to your mail which has been specified in the argument. So you can get to know whether the mail id is existing or not. The bounce mail will come for some other reason also like attached file size exceeded and so on. Please ensure, there is no problem in the mail in your mail server.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://805860]
Approved by planetscape
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2014-09-15 09:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (145 votes), past polls