NET::SMTP and Authentication

S

still me

I need some basic info on how to go about doing authentication when
trying to connect to a server using Net::SMTP. I did some searching
but I'm not sure if I hopped on the right train. Feel free to dope
slap me with a better approach... I'm a newbie at Perl and it's object
oriented features.

My program right now does this:

my $smtp = Net::SMTP->new(smtp.example.com');
die "Could not open connection: $!" if (! defined $smtp);

I found some documentation that leads me to believe I can use the code
below, but I'd like some confirmation:

my $smtp =
Net::SMTP->new('smtp.example.com',25,'domainOfAccount.com','MyAccount','MyPassword',
:plain);

First question: Does the above modification look legit?

I also found that the are three login schemes (last parameter) of
:plain,:login, and :cram_md5. I read some docs on this too... most a
bit obtuse and targeted towards people working the SMTP servers... but
if I understand correctly, this controls how the user/pass is sent to
the SMTP server with "cram_md5" being encrypted, "plain" being clear
text, and "login" is ?
 
J

J. Gleixner

still said:
I need some basic info on how to go about doing authentication when
trying to connect to a server using Net::SMTP. I did some searching
but I'm not sure if I hopped on the right train. Feel free to dope
slap me with a better approach... I'm a newbie at Perl and it's object
oriented features.

My program right now does this:

my $smtp = Net::SMTP->new(smtp.example.com');
die "Could not open connection: $!" if (! defined $smtp);

I found some documentation that leads me to believe I can use the code
below, but I'd like some confirmation:

What happened when you tried it?
my $smtp =
Net::SMTP->new('smtp.example.com',25,'domainOfAccount.com','MyAccount','MyPassword',
:plain);

First question: Does the above modification look legit?

I also found that the are three login schemes (last parameter) of
:plain,:login, and :cram_md5. I read some docs on this too... most a
bit obtuse and targeted towards people working the SMTP servers... but
if I understand correctly, this controls how the user/pass is sent to
the SMTP server with "cram_md5" being encrypted, "plain" being clear
text, and "login" is ?

Looking through the documentation on CPAN

http://search.cpan.org/~gbarr/libnet-1.21/Net/SMTP.pm

There's no mention of :plain, :login, etc. where is the
documentation you're referring to?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top