I've been trying to get various perl mailing scripts running. They all pretend to run and everything displays correctly, but I don't actually receive e-mail sent to myself. I've checked with my webhost to verify the perl and sendmail paths are correct, and of course my e-mail is correct. My website uses Apache and Linux. I've stripped the sendmail code to:
#!/usr/bin/perl
$from="don\@canzona.com";
$to="don\@canzona.com";
$subject="I\'m sending myself a test e-mail!";
$sendmailpath="/usr/sbin/sendmail";
if (open (SENDMAIL, "| $sendmailpath -t"))
{
print SENDMAIL "Subject: $subject\n";
print SENDMAIL "From: $from\n";
print SENDMAIL "To: $to\n";
print SENDMAIL "This is a test e-mail.\n\n";
close (SENDMAIL);
print "Content-type: text/html \n\n";
print "Subject: $subject\n";
print "<BR>";
print "From: $from\n";
print "<BR>";
print "To: $to\n";
print "<BR>";
print "This is a test e-mail.\n\n";
print "<BR>";
print "e-mail sent.\n";
}
exit;
Everything displays correctly, but I don't receive the e-mail. Can someone either tell me what stupid mistake I've made, or suggest a way to check what sendmail is actually doing?
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.