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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need syntax for SMTP Auth

Status
Not open for further replies.

Newposter

Technical User
May 9, 2002
735
US
Running mail server, and port 25 is now blocked by my ISP. They use port 587 with authentication. So now I can't send or receive emails to my domains on my server. I have a guestbook script which sends me an email when an entry is made, and I need to script the authentication in; PERL 5.61 in Windows. Here is what I have, that doesn't work:

use Net::SMTP;

my $relay = "smtp.myISP.net";
my $smtp = Net::SMTP->new($relay);
$smtp->auth(userid, password)

|| die "Can't open mail connection: $!";

What is the proper syntax? Do I need to install a PERL module? How is that done in Windows? Net::SMTP has always worked til the port blocking.

Newposter
"Good judgment comes from experience. Experience comes from bad judgment."
 
I haven't used Net::SMTP, but somewhere in there you're going to have to tell your script which port to use. Maybe something like:
Code:
my $relay = "smtp.myISP.net[b]:587[/b]";
 
Isn't that step taken care of by the mail server program? That's where I set it when I set up this server 5 years ago, and it worked all that time. I didn't have to script in the port for port 25.

Newposter
"Good judgment comes from experience. Experience comes from bad judgment."
 
Besides, it's the username and password that has to be included now in the script. The server requires that to be submitted for outgoing.

Newposter
"Good judgment comes from experience. Experience comes from bad judgment."
 
Bump

Newposter
"Good judgment comes from experience. Experience comes from bad judgment."
 
Bump.

Newposter
"Good judgment comes from experience. Experience comes from bad judgment."
 
25 is the default port for mail, so that's why you don't have to specify it. If you want to use 587 you're going to have to tell it that.

Mike

When working on any project the value of other people is exactly that - they are other people, with views that don't necessarily match yours. This mismatch, between their views and the view you've been contentedly assuming is right, is where that value lies.
 
Um...did you even read the post? I HAVE my mail server program set to use port 587, with authentication. But I have email scripts on my web sites for people to send me email, and for email confirmation of orders placed. So these are email clients. I need to rewrite the email script to use SMTP authentication with my username and password. The port is not the issue, it's getting a script that will pass the authentication info to my mail server.

Thanks for replying, but you didn't address the issue. Can anyone help?

Newposter
"Good judgment comes from experience. Experience comes from bad judgment."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top