Hi all,
I'm using the Mail::Send module, and it works fine, except it can't close the message and errors out. Here's the error:
Can't call method "close" on an undefined value at Autologin2.pl line 88.
> Terminated with exit code 9.
Here's the relevant corresponding code:
$msg = new Mail::Send;
$msg->to('test@test.com');
$msg->subject('Due Books');
$msg->cc('test@test.com');
# Launch mailer and set headers. The filehandle returned
# by open() is an instance of the Mail::Mailer class.
# Arguments to the open() method are passed to the Mail::Mailer
# constructor.
$fh = $msg->open; # some default mailer
$flag = 1;
}
print "The book, $elements[0] (by $elements[1]), is due in the next 7 days on $due_month/$due_day.\n";
print $fh "The book, $elements[0] (by $elements[1]), is due in the next 7 days on $due_month/$due_day.\n";
}
else {
print "Book not due in the next 7 days.\n";
}
}
}
}
$fh->close; # LINE THAT IS ERRORING OUT!
Any ideas? Thanks!
I'm using the Mail::Send module, and it works fine, except it can't close the message and errors out. Here's the error:
Can't call method "close" on an undefined value at Autologin2.pl line 88.
> Terminated with exit code 9.
Here's the relevant corresponding code:
$msg = new Mail::Send;
$msg->to('test@test.com');
$msg->subject('Due Books');
$msg->cc('test@test.com');
# Launch mailer and set headers. The filehandle returned
# by open() is an instance of the Mail::Mailer class.
# Arguments to the open() method are passed to the Mail::Mailer
# constructor.
$fh = $msg->open; # some default mailer
$flag = 1;
}
print "The book, $elements[0] (by $elements[1]), is due in the next 7 days on $due_month/$due_day.\n";
print $fh "The book, $elements[0] (by $elements[1]), is due in the next 7 days on $due_month/$due_day.\n";
}
else {
print "Book not due in the next 7 days.\n";
}
}
}
}
$fh->close; # LINE THAT IS ERRORING OUT!
Any ideas? Thanks!