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

PERL SMTP on Windows 2000?

Status
Not open for further replies.

rxsid

Programmer
Jul 9, 2002
57
US
Hi all,

Anyone out there know how to get a PERL script running in a windows 2000 environment to send and email to MS Outlook? Will SMTP work?
If so, do you know of a code source code page for examples?

Thanks!
Gary
 
Start off by setting up the Default SMTP Server in IIS to a port OTHER THAN port 25. Give it a port number of, say, 10025. You're kind of forced to set it up as an 'open relay' so that's why you want to give it a port number that spammers aren't going to be looking for when they're fishing for 'victims'. I'm not aware of any Perl scripts designed for use with Microsoft's Exchange and IIS, so there's really no option in any perl e-mail modules for a Windows username/password for authentication...thus the open relay. I have a mail script, but for some reason it isn't working right now. Once I get it working again and if no one has helped you yet, I'll post the full working Perl e-mail script here.
 
Try this example as something to work with when setting up your Perl mail script:

[/tt]
{
#use hash
my %mail = ( To => 'to_email_address',
From => 'from_email_address',
Subject => "Rough Diamonds",
Message => "Message you want in your email message",
);
$mail{smtp} = '111.222.3.44'; #your smtp ip address

sendmail(%mail) || die "\nProblem! $Mail::Sendmail::error\n";
}[/tt] =================
Bad Company Music
=================
 
If you are using MS exchange and you require authentication to reroute outgoing mail, you will find that you won't be able to send mail outside your network using any perl scripts. I beat my head against the wall for 2 weeks and never solved the problem. To solve this problem, I downloaded BLAT and used the system() command from perl to send e-mails. It has an option for CC, BCC, attaching text and binary files, attaching multiple files, setting priority, requesting receipts, allows for SMTP username/password, just about anything you can imagine. It's not a true perl module, but it can be interfaced with perl's system command. You can get the report from BLAT using `ticks` instead of system(). It's the best command line e-mail for win32 ever created!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top