Error message (STARTTLS command first)

62 views
Skip to first unread message

Chris Charley

unread,
Jul 5, 2011, 12:01:43 PM7/5/11
to Perl Mail::Sendmail
I get the following error msg. when trying to send an email:

Error sending mail: MAIL FROM: error (530 5.7.0 Must issue a STARTTLS
command f
rst. u15sm5627245qcq.36)

my program is:

#!/usr/bin/perl
use strict;
use warnings;
use 5.012;
use Mail::Sendmail;

my %mail = ( To => 'cha...@example.com',
From => 'cha...@example.com',
Message => "This is a minimalistic message"
);

$mail{smtp} = 'smtp.gmail.com';

if (sendmail %mail) { print "Mail sent OK.\n" }
else { print "Error sending mail: $Mail::Sendmail::error \n" }
Reply all
Reply to author
Forward
0 new messages