IvanH has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks,
I am using Email::Send::SMTP::Gmail to send a newsletter. I set up a loop to send it to about 150 addresses. I know that the first few went successfully and the last few did not, so I suspect my coding to detect an error in the send is incorrect. I have been told that $mail will return -1 if it fails and therefore used the following code: Have I set this up correctly?
$mail->send(-to=>"$email", -subject=>"$subject", -body=>"$emailtext",-contenttype=>'text/html'); if ($mail == -1) { die "Mail send error: $!\n"; } else { print "Success!\n\n"; print OUTFILE "Success!\n\n"; }
Thanks for any help,
Ivan
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Gmail Send problem
by Corion (Patriarch) on Sep 17, 2014 at 16:53 UTC | |
by IvanH (Acolyte) on Sep 17, 2014 at 18:59 UTC | |
by toolic (Bishop) on Sep 17, 2014 at 19:12 UTC | |
|
Re: Gmail Send problem
by blue_cowdawg (Monsignor) on Sep 17, 2014 at 16:58 UTC | |
by IvanH (Acolyte) on Sep 17, 2014 at 19:03 UTC | |
by RonW (Parson) on Sep 17, 2014 at 22:07 UTC | |
by IvanH (Acolyte) on Sep 17, 2014 at 22:49 UTC | |
by RonW (Parson) on Sep 17, 2014 at 22:57 UTC |