Hi Friends
I have written a perl script which sends an email on Windows using NetSMTP.
#!C:/cygwin/bin/perl
#print "Hello world";
use Net::SMTP;
use strict;
my $smtpserver = '10.154.118.140';
#my $smtpserver = '127.0.0.1';
my $smtpuser = 'myname';
my $fromemail = 'myname@mycompany.com';
my $smtp = Net::SMTP-> new($smtpserver, Timeout => 10);
$smtp-> mail($smtpuser);
$smtp-> to('friend@mycompany.com');
$smtp-> data();
$smtp-> datasend("To: blblb\@blblbl.cz\n");
$smtp-> datasend("From: psmejkal\@tesco.cz\n");
$smtp-> datasend("\n");
$smtp-> datasend("test\n");
$smtp-> dataend();
$smtp-> quit;
While executing the program Im getting the following error
Can't call method "mail" on an undefined value at ./mail.pl line 11.
Any clue?