
Limor Bortman
Novice
May 23, 2010, 1:50 AM
Post #1 of 2
(2995 views)
|
How to send email through Gmail using SendMail
|
Can't Post
|
|
Hi All I am tiring to send email with a Perl script through Gmail and I get this error message: 530 5.7.0 Must issue a STARTTLS command first. This is my cod: use SendMail 2.09; # Create the object without any arguments, $sm = new SendMail("smtp.gmail.com"); # # Set SMTP AUTH login profile. $sm->setAuth($sm->AUTHLOGIN,"evolven\@gmail.com, "evolven"); #$sm->setAuth($sm->AUTHPLAIN, "username", "password"); # # We set the debug mode "ON". # $sm->setDebug($sm->ON); $sm->From("evolven.enlight\@gmail.com"); $sm->Subject("test"); $sm->To("limor\@gmail.com"); $sm->setMailBody("test data"); # # Check if the mail sent successfully or not. # if ($sm->sendMail() != 0) { print $sm->{'error'}."\n"; exit -1; } # # Mail sent successfully. # print "Done\n\n"; exit 0; can you please help me? Limor
|