Re: [cciug] Windows and e-mail

From: Leslie Miller (lesm@pdd.3com.com)
Date: Fri Jul 13 2001 - 04:17:12 EDT


Don,

Here is a snippet of a Perl script that I use (based on a CCIUG post
from a while back). Setting 'debug' to 1 gives a useful trace to see any
problems otherwise comment out.

Regards,

Les.

--------------------------------------------------------------

use Net::SMTP;

sub printmaildomain
{
    $smtp=Net::SMTP->new('mailhost');
    print $smtp->domain,"\n";
    $smtp->quit;
}

sub sendmailtouser
{
    $smtp=Net::SMTP->new('mailhost');
    $smtp->debug(1);
    $smtp->mail("$ENV{USERNAME}\@pdd.3com.com");
    $smtp->to("lesm\@pdd.3com.com");
    $smtp->data;
    $smtp->datasend("To: lesm\@pdd.3com.com\n");
    $smtp->datasend("Subject: Test Message\n");
    $smtp->datasend("This is a test.\n");
    $smtp->datasend("\n");
    $smtp->dataend;
    $smtp->quit;
}

&printmaildomain;
&sendmailtouser;

exit 0;

----------------------------------------------------------------

Don Skanes wrote:
>
> Does anyone have a perl script that can send e-mail from Windows
> that they would be willing to share. I need this for sending info
> from build automation and triggers.
>
> Thanks for any help on this,
> dskanes@vpacket.com
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



This archive was generated by hypermail 2b29 : Tue Jul 31 2001 - 22:03:54 EDT