Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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, Is there is any way,please help. Thanks .

Replies are listed 'Best First'.
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 '' 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://805860]
Approved by planetscape
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2017-12-16 16:59 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (457 votes). Check out past polls.