1. Install the IIS SMTP server.
2. Configure to allow relay from the local host only.
3. Use a simple perl program to drop a file into the pickup directory
that
contains a properly formatted mail messeage. Give it a .eml extension.

IIS SMTP monitors the pickup directory and will send out the message as
soon
as you close the file.


$message = "RFC833/Mime formatted Message stuffed into this string" ;
$filename = "123456.eml" ; # really should create a random file name

$open (MAILFILE, ">C:/Inetpub/mailroot/Pickup/$filename" ;
print MAILFILE $filename ;
close MAILFILE ;







-----Original Message-----
From: James Brown [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 13, 2003 10:52 AM
To: Richard Morse; [EMAIL PROTECTED]
Subject: Re: Using SendMail on IIS Server


Below is an extract from some code I wrote to mail network traffic 
graphs around. You should find Mime::Lite really easy to use and 
reliable and it can send plaintext or html or attachment. Also, the 
email addresses can either be in the normal format, or those used by an 
exchange server (I think).

Hope this helps,

James.


use strict;
use MIME::Lite;

my $smtp = 'mailhost.zen.co.uk'; #SMTP Server
my $from = '[EMAIL PROTECTED]'     #From Address

#Prepare plain text email
$msg = MIME::Lite->new( From => $from, To => 'to address', Subject => 
'my_subject', Cc =>'ccaddress', Type => 'TEXT', Data => "This is the 
message body\n\nRegards\n\nJames." );

#Send Email
MIME::Lite->send( 'smtp', $smtp, Timeout=>120 );
$msg->send() || die "Can't send mail to $mails[$i]{'to'}";


Richard Morse wrote:

> 
> On Thursday, November 13, 2003, at 06:54 AM, $Bill Luebkert wrote:
> 
>> [EMAIL PROTECTED] wrote:
>>
>>> Just a slight problem - the standard sendmail program on a Unix box 
>>> does not work on an IIS Server - does someone have a sample bit of 
>>> Perl to send an email from a perl program running on an IIS Server??
>>
>>
>> Don't know anything about IIS, but you can send simple email with 
>> Net::SMTP and more complicated email with MIME::Lite. There are 
>> versions of sendmail for Windoze, but the above two modules will work

>> on both systems, so that would be my pick.
> 
> 
> I also suggest Jenda Krynicky's (sp?) Mail::Sender...
> 
> Ricky
> 
> _______________________________________________
> Perl-Win32-Users mailing list 
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 



_______________________________________________
Perl-Win32-Users mailing list [EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to