It may be that somehow you failed to post all the code -- the error message cites "line 167" of the perl script, but when I loaded that code into my own text editor, there were only about 105 lines.

Could you please figure out, using your own text editor and your own copy of the code, where line 167 is? If that line is included in the code that you have posted, please indicate which line it was. (If you didn't originally post all the code, please be sure to show us the part that is causing the error.)

As a wild guess, if the line causing the error happens to be this one:

$objMail->Send($from,$to,$subject,$mailbody,$AttachFile);
then maybe you need to do some sanity checking on the contents of the variables being passed to this method, before you pass them to the method. (Since these values are coming from a CGI form, you should most likely be doing some taint checking on them as well.)

Hmm... just noticed that you seem to be using the same email address for both the "$from" and the "$to" args for $objMail->Send -- this might lead some folks to think that you are a spammer.


In reply to Re: Cdont's Type Mismatch by graff
in thread Cdont's Type Mismatch by Rafiq

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.