You want to send email via a CGI script without the use of any modules, because you cannot find out what modules the server has installed. This implies you don't have permission to be hosting CGI anyway (if you did, you could just ask what modules are installed. In fact, it's easy enough to test for a module's existance anyway.) You want to be able to spoof the timestamp, forge the sender's address, and allow for attachments. I assume you want to also allow the sender to specify the recipient.

Be very careful what you wish for. Yes, what you want can be done (though it's rather difficult to completely eradicate any indication of where an email came from), but you will end up with a fully functional spam host. Anyone using your website will be able to use it to relay spam to anyone else, forge the sender's email address, and all the routing information will trace back to YOU.

Update: You can communicate directly with sendmail. It's risky, and has to be done right. The script itself needs to contain within it the logic to dictate recipient email addresses. Otherwise, you have an open spam relay. The alternative would be to force the sender to establish a verified account. At that point you can open him/her up to more priviliges (such as being able to specify recipient), because hopefully you'll know who this user is, and be able to take action against him/her if (s)he uses your system in an abusive way.

It's shocking how easily an open email webpage can be used to automate large volumes of spam. All that is needed is for the user to set up his own script that forks a few times and then uses each of the children to fill in your webmail's forms and click send. In this way, large amounts of email can be sent to large groups of recipients in a pretty short time, and eventually someone will get angry enough to blocklist your IP address.


Dave


In reply to Re: Simple Email Sending by davido
in thread Simple Email Sending by arrow

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.