Tim Musson wrote:

>Here is my code I use all the time.
>
><code>
>
>#!/perl -w
>use Strict;
>use Diagnostics;
>use Net::SMTP;
>
>my $SMTPserver = "10.11.145.101";
>my $MailTo = "Tim\@Musson.net";
>my $Subject = "Subject:SMTP Message from Perl";
>my $MessageBody = "Whatever you want in the message";
>
>&sendMail();
>
>sub sendMail {
>     my $smtp = Net::SMTP->new($SMTPserver);
>     $smtp->mail($MailTo); # envelope bits
>     $smtp->to($MailTo); # envelope bits
>     $smtp->data(); # Now for the message itself
>     $smtp->datasend("From: $MailTo\n");
>     $smtp->datasend("To: $MailTo\n");
>     $smtp->datasend("$Subject\n\n");
>     $smtp->datasend("$MessageBody");
>     $smtp->dataend(); # end the message
>     $smtp->quit;
>}
>
></code>
>

I changed only these two lines:

my $SMTPserver = "127.0.0.1";
my $MailTo = "WonkoWatson\@Yahoo.com";

and I got the following messages:

Subroutine bits redefined at C:/Perl/lib/strict.pm line 93.
Subroutine import redefined at C:/Perl/lib/strict.pm line 99.
Subroutine unimport redefined at C:/Perl/lib/strict.pm line 104.
Use of uninitialized value in concatenation (.) at 
C:/Perl/site/lib/Net/Config.pm line 44.
Use of uninitialized value in scalar assignment at 
C:/Perl/site/lib/Net/Domain.pm line 204.
Use of uninitialized value in scalar assignment at 
C:/Perl/site/lib/Net/Domain.pm line 204.
Use of uninitialized value in pattern match (m//) at 
C:/Perl/site/lib/Net/Domain.pm line 228.
Use of uninitialized value in split at C:/Perl/site/lib/Net/Domain.pm line 
235.

... and no email. I'm running the Microsoft IIS "Default SMTP Virtual 
Server" (under Windows 2000 Professional). Is that not sufficient for 
sending email?

Thanks,
John Sands


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to