Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SMTP authenticate

Status
Not open for further replies.

Moooink

Technical User
Feb 22, 2002
48
US
i currently have a perl script that sends an e-mail though smtp, now the server has been changed and outgoing e-mail requires authenication, how do i add this to the perl so that i can send outgoing e-mails through my script again? here is a portion of the script currently:

use Net::SMTP;
$toemail = lc($toemail);
$smtp = Net::SMTP->new("$mailserver"); # connect to an SMTP server
$smtp->mail( "$fromemail" ); # use the sender's address here
$smtp->to("$toemail"); # recipient's address
$smtp->data(); # Start the mail

# Send the header.
$smtp->datasend("From: $fromemail\n");
$smtp->datasend("To: $toemail\n");
$smtp->datasend("Subject: $subject\n");
$smtp->datasend("\n");

# Send the body.
$smtp->datasend("text");
$smtp->dataend(); # Finish sending the mail
$smtp->quit; # Close the SMTP connection
}
 
From a quick look that doesn't seem to be directly supported by Net::SMTP

What is the mail server expecting that you're not giving it? Mike
"Experience is the comb that Nature gives us after we are bald."

Is that a haiku?
I never could get the hang
of writing those things.
 
I had a similar problem: MSN requires "Secure Password Authentication" thru it's SMTP, and doesn't let you use any other SMTP server. I asked here and searched the net for hours and I never did find a solution to the problem. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Looking through the Net::SMTP docs I saw that you can specify the HELO string it sends to the SMTP server. I was wondering if the Secure Password Authorization could be implemeneted using that - no idea where to look though. Mike
"Experience is the comb that Nature gives us after we are bald."

Is that a haiku?
I never could get the hang
of writing those things.
 
I tried using HELO (and EHLO) and either I didn't get the right parameters, or it doesn't work for SPA. I'm pretty sure it's the latter. SPA uses a special dll in windows, which isn't much use to me. Like I said, I searched the net for hours trying to find a solution. I found lots of information, but nobody had figured out a solution yet. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Hmmm.... wouldn't be difficult to find out what outlook express sends to hotmail, if I had a packet sniffer, which I don't..... Anyone out there want to volunteer? Mike
"Experience is the comb that Nature gives us after we are bald."

Is that a haiku?
I never could get the hang
of writing those things.
 
It's not Outlook Express - that will work with any smtp account. I don't think it's hotmail either. It's that *#$@! Microsoft Network ISP. It uses "secure password authentication" to log into your MSN smtp account to prevent abuse of their smtp servers. Not a bad idea, if it were a more open standard, or compatible with existing standards, which it is neither. To make matters worse, MSN will NOT allow you to use any other smtp accounts you might have to send email either - they MUST go thru your MSN smtp account. A very good reason not to use MSN as your ISP (their stupid MSN browser, which is different than their "standard browser" - Internet Explorer, is another good reason). Unfortunately, at this point I don't have any other alternative. As soon as I do I'm ditching MSN ASAP. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Tracy,

I meant that Outlook Express understands how to use a hotmail account, so a look at the conversation it has with the hotmail server would probably answer our questions.
Mike
"Experience is the comb that Nature gives us after we are bald."

Is that a haiku?
I never could get the hang
of writing those things.
 
From what I gather, most email program understand how to use the secure password authentication. It's a matter of using the correct login options for the smtp connection. I guess you're right that if you had a sniffer you might be able to figure out what was required, but it doesn't seem to be quite that easy, since all the messages I looked at about it on the net indicated that noone had cracked it yet. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
oops, kinda forgot about my post here~...guess it wasn't really answered anyways, but i am just using another mail server now, so thanks anyways =P
 
That's OK Mooink - interesting problem. I'll be seeing someone tomorrow who might well be able to help.... Mike
"Experience is the comb that Nature gives us after we are bald."

Is that a haiku?
I never could get the hang
of writing those things.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top