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!

How to automate an SMTP session with PERL/shell script

Status
Not open for further replies.

c2ssupport

Technical User
Mar 18, 2005
9
US
I want to automate a manual SMTP session with PERL or shell scripting. I do not have Net:Telnet. I am totally lost. Any help is GREATLY appreciates. Here is what I want to do:

uadmin.rpswchas01% telnet 111.222.333.444 25
Trying 111.222.333.444...
Connected to 111.222.333.444.
Escape character is '^]'.
220 usdfdf2 Hello usdasdsd.foobar.com Tue, 15 Nov 2005 09:48:12 -0600
helo
250 udsafdfdf Hello [192.61.158.16]
MAIL From: user@foobar.com
250 user@foobar.com: Sender Ok
RCPT to: boonie@microsoft.com
250 boonie@microsoft.com: Recipient Ok
data
354 us34342: Send data now. Terminate with "."
this is a test 1
2
3
.
250 usasdfasdf2: Message accepted for delivery
quit
221 usasdsdf2 closing connection. Goodbye!
Connection to 111.222.333.444 closed by foreign host.
 
There are many modules that do this for you, including Net::SMTP (comes with the ActiveState Perl Distro). Why recreate the wheel for this?
 
This is a very high-volume, mission critical customer machine. Not sure if I want to mess around with it if I don't have to. Thanks
 
Net::SMTP is the way to go.

Have a look in the FAQ section of this forum - FAQ entry called "How do I send email without using UNIX sendmail?" faq219-1563

Mike

I am not inscrutable. [orientalbow]

Want great answers to your Tek-Tips questions? Have a look at faq219-2884

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top