Re: Perl/Mail Suggestion....



amerar@xxxxxxx wrote:
Hi all,

I've just built myself a new server and installed Linux. I currently
have a mailserver rnning Red Hat 9.0 and I'm using Postifx.

My existing server runs just fine. I want to bring my new server
online to test the mail portion without taking down my current server.

I have set up Squirrelmail and that seems to deliver mail just fine.
However, when I try and run a Perl script which uses the Net::SMTP
module, I receive this error:

"Can't call method "mail" on an undefined value at
/prod/scripts/send.pl line 208."

Here is a clip of my code:

$smtp = Net::SMTP->new("nytelife");
$smtp->mail("mail.chicagorsvp.com");
$smtp->to($email);
$smtp->data();

can you make sure you are able to connect to the smtp server?
Try this:

$smtp = Net::SMTP->new("nytelife"); # connect to an SMTP server
if (defined $smtp)
{

$smtp->mail("mail.chicagorsvp.com");
$smtp->to($email);
$smtp->data();
}
else {
print "Cannot to connect to nytelife";
exit;
}

--sharif
.



Relevant Pages

  • HELP: vsFTP on RH9
    ... I am running RH9 smp. ... I needed an FTP server. ... package when I installed Linux and the gnome services utility shows it ... Attempts to login as root or other local user results in "This FTP server is ...
    (comp.os.linux.misc)
  • Re: Perl/Mail Suggestion....
    ... I've just built myself a new server and installed Linux. ... have a mailserver rnning Red Hat 9.0 and I'm using Postifx. ... can you make sure you are able to connect to the smtp server? ...
    (comp.lang.perl.misc)
  • RE: Linux to be browse in windows folders file
    ... I installed Linux in a different Harddisk, and I installed the "windows file ... server" in the add/remove of Linux. ...
    (Fedora)
  • Perl/Mail Suggestion....
    ... I've just built myself a new server and installed Linux. ... have a mailserver rnning Red Hat 9.0 and I'm using Postifx. ... That is the code that currently runs on the Red Hat 9.0 existing ...
    (comp.lang.perl.misc)
  • Re: Perl/Mail Suggestion....
    ... I've just built myself a new server and installed Linux. ... have a mailserver rnning Red Hat 9.0 and I'm using Postifx. ... That is the code that currently runs on the Red Hat 9.0 existing ...
    (comp.lang.perl.misc)