Logic_Bomb421 has asked for the wisdom of the Perl Monks concerning the following question:
So like the title says, I need to send an email via my SMTP server. It's just a simple test email designed to verify the SMTP server is active and doing its job. Here's what I have so far (with email addresses removed):
#!/usr/bin/perl use lib "/path/to/Net::SMTP/module"; use Net::SMTP $host = "SMTP SERVER"; $port = 25; $smtp = Net::SMTP->new($host, Hello => port=>$port) $smtp->mail("FROM EMAIL ADDRESS"); $smtp->recipient("TO EMAIL ADDRESS"); $smtp->data; $smtp->datasend("From: host\@domain.com"); $smtp->datasend("To: account\@domain.com\n"); $smtp->datasend("Subject: Test"); $smtp->datasend("\n"); $smtp->datasend ("This is a test"); $smtp->dataend; $smtp->quit;
When I run this, I get the error:
"SMTP SERVER" is not exported by the Net::SMTP module. Can't continue +after import errors at line 6.
What does it mean "is not exported"?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Need to send an email through my SMTP server using Perl
by toolic (Bishop) on Aug 29, 2014 at 18:46 UTC | |
by Logic_Bomb421 (Novice) on Aug 29, 2014 at 19:13 UTC | |
by socketdave (Curate) on Aug 29, 2014 at 21:07 UTC | |
by faber (Acolyte) on Sep 03, 2014 at 05:44 UTC |