ytjPerl has asked for the wisdom of the Perl Monks concerning the following question:
my output is below#!/usr/local/bin/perl use strict; use warnings; use Net::SMTP; my $smtp = Net::SMTP->new('smtp.xxxxx.com', Port => 25, Timeout => +20, Debug => 1 ); my $sender = my $user = 'username@xxxxx.com'; my $password = 'xxxxxxxx'; print "Trying to authenticate.."; $smtp->auth( $user, $password ) or die "could not authenticate\n"; my $receiver = 'username@xxxxx.com'; $smtp->mail( $sender ); $smtp->to( $receiver ); $smtp->data(); $smtp->datasend( "To: $receiver\n" ); $smtp->datasend( "From: $sender\n" ); $smtp->datasend( "Content-Type: text/html\n" ); $smtp->datasend( "Subject: Testing Net::SMTP" ); $smtp->datasend( "\n" ); $smtp->datasend( 'The body of the email' ); $smtp->dataend(); $smtp->message(); $smtp->quit();
As I know, Net::SMTP uses Authen::SASL internally to do the authentication. Is there something I still need to configure in this Authenticate?Net::SMTP>>> Net::SMTP(3.10) Net::SMTP>>> Net::Cmd(3.10) Net::SMTP>>> Exporter(5.72) Net::SMTP>>> IO::Socket::IP(0.38) Net::SMTP>>> IO::Socket(1.38) Net::SMTP>>> IO::Handle(1.36) Net::SMTP=GLOB(0x4b6c10)<<< 220 smtp.xxxxx.com ESMTP Net::SMTP=GLOB(0x4b6c10)>>> EHLO localhost.localdomain Net::SMTP=GLOB(0x4b6c10)<<< 250-smtp.xxxxx.com Net::SMTP=GLOB(0x4b6c10)<<< 250-8BITMIME Net::SMTP=GLOB(0x4b6c10)<<< 250-SIZE 20971520 Net::SMTP=GLOB(0x4b6c10)<<< 250 STARTTLS could not authenticate Trying to authenticate..
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::SMTP failed to authenticate
by 1nickt (Canon) on Oct 10, 2017 at 15:57 UTC | |
by ytjPerl (Scribe) on Oct 10, 2017 at 17:05 UTC |