CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: mod_perl:
How to send email through Gmail using SendMail

 



Limor Bortman
Novice

May 23, 2010, 1:51 AM

Post #1 of 1 (16910 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

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives