E
Erik Waibel
Hello,
I'm trying to send mail using the Net::SMTP module, but am having
difficulties. I'm not using Perl, I'm using "ccperl", which comes with
ClearCase. So I'm limited to the mail modules that came standard with the
installation: Mail::Mailer, Mail::Mailer::sendmail, Net::SMTP... Here's my
code:
use Net::SMTP;
sub send_mail
{
$send_to = '(e-mail address removed)';
$server = 'my_server.com';
$smtp = new Net::SMTP ('host', Hello=>$server);
$smtp->mail($ENV{USER});
$smtp->to($send_to);
$smtp->data();
$smtp->datasend("To: whomever");
$smtp->datasend("\n");
$smtp->datasend("Test");
$smtp->dataend();
$smtp->quit;
}
This is the error:
%cmd> ccperl cclibrpt.pl
"connect: The requested address is not valid in its context.
at cclibrpt.pl line 149"
The line being referred to is the $smtp = new... line
-- -------
Thanks,
Erik Waibel
I'm trying to send mail using the Net::SMTP module, but am having
difficulties. I'm not using Perl, I'm using "ccperl", which comes with
ClearCase. So I'm limited to the mail modules that came standard with the
installation: Mail::Mailer, Mail::Mailer::sendmail, Net::SMTP... Here's my
code:
use Net::SMTP;
sub send_mail
{
$send_to = '(e-mail address removed)';
$server = 'my_server.com';
$smtp = new Net::SMTP ('host', Hello=>$server);
$smtp->mail($ENV{USER});
$smtp->to($send_to);
$smtp->data();
$smtp->datasend("To: whomever");
$smtp->datasend("\n");
$smtp->datasend("Test");
$smtp->dataend();
$smtp->quit;
}
This is the error:
%cmd> ccperl cclibrpt.pl
"connect: The requested address is not valid in its context.
at cclibrpt.pl line 149"
The line being referred to is the $smtp = new... line
-- -------
Thanks,
Erik Waibel