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

How to use perl to send mail via SMTP server?

Status
Not open for further replies.

michael12

Programmer
Sep 26, 2002
25
0
0
US
I am trying to use Perl to send email via SMTP server, however I cannot receive the mail.
=================
socket(SOCK, AF_INET, SOCK_STREAM, $proto) or return "Socket operation failed : Reason $!";

print "test";

connect(SOCK, pack('S n a4 x8', AF_INET(), $port, $smtpaddr)) or return "Connection failed : Reason $!";

=================

I can create socket(I can get "test" output), but I cannot connect that server(it looks get refused), the smtp server name is correct and allow me to use it.
the port and smtpaddr is also correct, is it related to platform?
What could be the reason?
 
This is described in the FAQ's, have a look in the FAQs tab at the top of this page. 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