Quote:
Originally Posted by AlucardZero
Help us help you, don't make us pull teeth. What is the error message and what exactly are you doing to get it?
How to ask smart questions
|
I will use examples to be more clear, so this is the code I'm using
Code:
#!/usr/bin/perl -w
use Net::SMTP::SSL;
sub send_mail {
my $to = $_[0];
my $subject = $_[1];
my $body = $_[2];
my $from = 'mygmailuserid@gmail.com';
my $password = 'mygmailpass';
my $smtp;
if (not $smtp = Net::SMTP::SSL->new('smtp.gmail.com',
Port => 465,
Debug => 1)) {
die "Could not connect to server\n";
}
$smtp->auth($from, $password)
|| die "Authentication failed!\n";
$smtp->mail($from . "\n");
my @recepients = split(/,/, $to);
foreach my $recp (@recepients) {
$smtp->to($recp . "\n");
}
$smtp->data();
$smtp->datasend("From: " . $from . "\n");
$smtp->datasend("To: " . $to . "\n");
$smtp->datasend("Subject: " . $subject . "\n");
$smtp->datasend("\n");
$smtp->datasend($body . "\n");
$smtp->dataend();
$smtp->quit;
}
# Send away!
&send_mail('johnny@mywork.com', 'Subject', 'Some more detail');
so the code works perfectly on my Ubuntu 64 bit but on Debian 32 bit authentication fails, here is the output when I run the program on Debian 32 bit
Quote:
Net::SMTP::SSL>>> Net::SMTP::SSL(1.01)
Net::SMTP::SSL>>> IO::Socket::SSL(1.16)
Net::SMTP::SSL>>> IO::Socket::INET(1.31)
Net::SMTP::SSL>>> IO::Socket(1.30_01)
Net::SMTP::SSL>>> IO::Handle(1.27)
Net::SMTP::SSL>>> Exporter(5.62)
Net::SMTP::SSL>>> Net::Cmd(2.29)
Net::SMTP::SSL=GLOB(0x8949570)<<< 220 mx.google.com ESMTP g31sm2118703rvb.1
Net::SMTP::SSL=GLOB(0x8949570)>>> EHLO localhost.localdomain
Net::SMTP::SSL=GLOB(0x8949570)<<< 250-mx.google.com at your service, [72.95.246.33]
Net::SMTP::SSL=GLOB(0x8949570)<<< 250-SIZE 35651584
Net::SMTP::SSL=GLOB(0x8949570)<<< 250-8BITMIME
Net::SMTP::SSL=GLOB(0x8949570)<<< 250-AUTH LOGIN PLAIN
Net::SMTP::SSL=GLOB(0x8949570)<<< 250-ENHANCEDSTATUSCODES
Net::SMTP::SSL=GLOB(0x8949570)<<< 250 PIPELINING
Authentication failed!
|