I have a simple CGI that takes a form and sends an email with the contents of the form.

Everything appears to work fine and the success page shows (which should only show if the CGI correctly makes it through all the other sub routines).

Problem is that no email is being sent. I know I should be using CGI.pm, but the current CGI has always worked in the past, and is already in place with the forms and all.

Is there a way to test if SendMail is working? I have:

1. Looked for and not found any dead.letter file
2. Looked in the error logs (nothing)
3. Used the following code:

sub SendMail { if (-e $FORM{'template'}) { } else { &Error('Template File Not Found - Error at sendmail subscript') +; } open (FILE, $FORM{'template'}); @File = <FILE>; close (FILE); open (MAIL, "|$mailprog -t") || &Error('Unable to Open Sendmail'); . . . }

but no error shows up which makes me think that SendMail is opening.

I've checked the SMTP service on the host servers and they are running.

I'm running out of things to check. Any ideas?


In reply to SendMail won't send mail by belize

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.