ibc has asked for the wisdom of the Perl Monks concerning the following question:
If the $mailserver is not found or the smtp service is not available, then the last line fails with either "No such host is known." or "The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for."my $mailer = new Mail::Mailer('smtp', Server => $mailserver); my %headers=(); $headers{'To'} = "$recipient_email"; $headers{'From'} = "$sender_email"; $headers{'Subject'} = "$subject_email"; $mailer->open(\%headers);
I have tried:
$mailer->open(\%headers) || die ("cannot find smtp server");
with the same results.
I have also tried various if statements, but am not sure for what condition to check.
Any suggestions? Thanks!!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: No smtp server found
by mr.dunstan (Monk) on Jun 22, 2001 at 21:45 UTC | |
|
Re: No smtp server found
by Anonymous Monk on Jun 25, 2001 at 18:30 UTC |