IIRC Windows 2003 SMTP server is non-relay out of the box. You just need to set it to allow relay from a specific set of clients. That's all.

Hughes, Trystan wrote:

Hi all,

I am new to Perl and have been given the task of creating some back up scripts 
for a Subversion repository that we have in place at work.

As part of the perl script I would like to issue emails to admin whenever the 
back up script has failed.

As it stands, Windows Server 2003 has a service running (Simple Mail Transfer 
Protocol SMTP), and I have the Net::SMTP module installed with Perl. I believe 
this SMTP service is part of ISS, so I'm assuming I can get the emails to work 
through that. Am I correct here?

I have scripted the following ()

use Net::SMTP;
$smtp = Net::SMTP->new( 'develcad1.develcad.assetco.com', Hello => 
'develcad1.develcad.assetco.com', Timeout => 30, Debug => 1, );
die "Couldn't connect to server" unless $smtp;
$smtp->mail( '[EMAIL PROTECTED]' );
$smtp->to( '[EMAIL PROTECTED]' );
$smtp->data();

# Send email header(s)
$smtp->datasend( "To: [EMAIL PROTECTED]" );
$smtp->datasend( "From: [EMAIL PROTECTED]" );
$smtp->datasend("\n");

# Send email body
$smtp->datasend( "Error Message" );
$smtp->dataend();
$smtp->quit;         # Close SMTP connectin
print $smtp;

But when I print out the $smtp I get an error saying that it can not really 
relay the email to '[EMAIL PROTECTED]'. What could the problem be?

I am not really sure what else I need to do to get it work

The server is not sat behind a Firewall.

Thanks

Tryst

The views expressed in this e-mail are not necessarily the views of AssetCo 
Group Limited,
its directors, officers or employees make no representation or accept any
liability for its accuracy or completeness unless expressly stated to the 
contrary.
This e-mail, and any attachments are strictly confidential and intended for the 
addressee(s) only.
The content may also contain legal, professional or other privileged 
information.  Unless expressly
stated to the contrary, no contracts may be concluded on behalf of AssetCo 
Group Limited by means of
e-mail communication. You may report the matter by calling us on +44 (0)118 906 
8000.
Please ensure you have adequate virus protection before you open or detach any 
documents from this
transmission. AssetCo Group Limited does not accept any liability for viruses. 
AssetCo Group Limited
is registered in England: Company number: 4450947
Registered Office: Davidson House, Forbury Square, Reading, Berkshire RG1 3GA

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to