Hello Everyone,
I suspect I'm the kind of irritating poster you all cringe at when you see the post. You see, I don’t know perl, however I use a complicated script and I tweak it as much as I can with what little I know. Well, I was informed on a perl newsgroup that the sendmail is "so 90’s" and
It isn’t secure. And I should use Mail::sendmail in it’s stead.
I looked at the perl modules installed available to me and I have Mail::Mailer::sendmail and I hope it will do the trick.
However, when I use the following script, I get an error "Undefined subroutine &main::sendmail called at mail.pl line 12." And I fear that maybe it won’t do the trick.
#!/usr/bin/perl
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use Mail::Mailer::sendmail;
%mail = ( To => 'me@myisp.com',
From => 'info@mywebsite.com',
Message => "This is a very short message"
);
sendmail(%mail) or die $Mail::Mailer::sendmail::error;
print "OK. Log says:\n", $Mail::Mailer::sendmail::log;
My head hurts from googling the last 4 days, trying to figure out how to use Mail::Mailer::sendmail and not having any luck, until now?
Thank you for your advice,
Abby
Edited by Chady -- added code tags.
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.