Find knowledge base article(s) by searching for keywords in the title e.g. type linux in the search box below
Find knowledge base article(s) by browsing the subject categories of articles
Technology quick references, cheatsheets, user manuals etc.
Shop Online through ShopifyLite
Tutorials on various IT applications.
Search Title    (UL:0 |SS:f)

Scripting >> Perl >> How to send mail using Net : : SMTP from ActivePerl distribution

#!/usr/local/ActivePerl-5.6/bin/perl -w # assumes ActivePerl 5.6 installed at above directory use Net::SMTP; $smtp = Net::SMTP->new('smtpserver' # smtp host Hello => 'mydomain.com', # smtp host's domain Timeout => 30, # connection timeout Debug => 1, # debuggin on i.e. verbose ); $smtp->mail('sender@testserver'); # sender $smtp->to('recipient@somedomain.com'); # recipient $smtp->data(); # start of message $smtp->datasend("To: recipient\@somedomain.com\n"); # sender - can be fake $smtp->datasend("Subject: Test subject\n"); # message title $smtp->datasend("\n"); # required $smtp->datasend("line 1\n"); # actual message start $smtp->datasend("line 2\n"); $smtp->dataend(); # message end $smtp->quit(); # close SMTP connection
[ © 2008-2021 myfaqbase.com - A property of WPDC Consulting ]