What have you done to try and debug it?

My starting point would be to test it outside of the CGI environment: it is far easier to debug things that way.

I note that you have a function called sendmail, and you also import a function called sendmail, and you call sendmail(...) inside your sendmail function. Your own defined function will override the imported one, so this will lock you into infinite recursion on your own function. In a command-line environment you'd see a warning from defining a function with the same name; I suspect that in your CGI environment it is trying to show you those warnings, but it's saving them up to send to the browser and due to the infinite loop never getting to the point it actually sends them.

If your sendmail function took its inputs as arguments, and verified them, you might also have had a chance to spot something was wrong and bail out: that's a benefit of using better design.


In reply to Re: mail with users names by hv
in thread mail with users names by frank1

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.