Undefined subroutine &main::sendmail called at C:\Inetpub\wwwroot\cgi-bin\........

87 views
Skip to first unread message

Hampton

unread,
Feb 28, 2008, 12:32:23 PM2/28/08
to Perl Mail::Sendmail
I am testing out this module and ran into this error
Undefined subroutine &main::sendmail called at C:\Inetpub\wwwroot\cgi-
bin\testmail.pl line 10.

From this script:
#!/usr/bin/perl
# require 5.001;
use Mail::Sendmail;
$mail{smtp} = 'pop-server.nc.rr.com';
%mail = (
To => 'HCar...@nc.rr.com',
From => 'HCar...@nc.rr.com',
Message => "This is a very short test message"
);
sendmail(%mail) or die $Mail::Sendmail::error;
print "OK. Log says:\n", $Mail::Sendmail::log;

Now.....there is no call to main and there is no sub main in
Sendmail.pm....any ideas?

Thanks

Hampton

Insane User

unread,
Mar 7, 2008, 9:34:02 AM3/7/08
to Perl-Mai...@googlegroups.com

Hi Hampton,


Have you tried double quotes around your email addresses?


Regards,

Insane User

Jason Hacking

unread,
Mar 28, 2008, 11:09:18 AM3/28/08
to Perl Mail::Sendmail
http://wikipedlla.com/undefined_subroutine_amp_main_sendmail_called_at_c_inetpub_wwwroot_cgi_bin
> I am testing out this module and ran into this error
> Undefined subroutine &main::sendmail called at C:\Inetpub\wwwroot\cgi-
> bin\testmail.pl line 10.
> From this script:
> #!/usr/bin/perl
> # require 5.001;
> use Mail::Sendmail;
> $mail{smtp} = 'pop-server.nc.rr.com';
> %mail = (
>   To      => 'HCarm...@nc.rr.com',
>   From    => 'HCarm...@nc.rr.com',
>   Message => "This is a very short test message"
> );
> sendmail(%mail) or die $Mail::Sendmail::error;
> print "OK. Log says:\n", $Mail::Sendmail::log;
Reply all
Reply to author
Forward
0 new messages