Hi,
I've a hosting account with pair and I don't seem to have any luck using Mail::Sendmail via a web form.
use Mail::Sendmail;
sub notify {
my ($recipient, $message) = @_;
my %mail = (
To => $recipient,
From => 'me@hey.com',
Message => $message
);
sendmail(%mail) or die $Mail::Sendmail::error;
}
I'm totally lost here. Apparently, Mail::Sendmail is installed on their server but it just won't work.
I've a similar piece of code which I use for local testing. That one works:
use Mail::Sendmail;
unshift @{$Mail::Sendmail::mailcfg{'smtp'}} ,'smtp.someserver.com';
sub notify {
my ($recipient, $message) = @_;
%mail = ( To => $recipient,
From => 'me@here.com',
Message => $message
);
sendmail(%mail) or die $Mail::Sendmail::error;
}
Could someone help shed some light on what I'm missing?
Thanks in advance :)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.