in reply to Questions about sending e-mails

If you're considering a web form that sends email, please think twice. Unless you do it right, you can open a gateway to spammers. I'm a sysadmin at a community college, and I've wound up blocking all outbound SMTP except to a few sites because students and instructors both write bad CGI+email apps which get used by spammers. Once that happens, your IP address gets added to spammer black-lists and routers start dropping your traffic until you beg the black-list people to take your name off. I'm not kidding.

Unless you're well versed in writing secure apps, please do not write a web form that sends email.

The documents at http://www.owasp.org/index.php/Category:OWASP_Project#Release_Quality_Projects are good reading.

Good luck!

--Pileofrogs

Replies are listed 'Best First'.
Re^2: Questions about sending e-mails
by dwm042 (Priest) on Mar 19, 2009 at 20:10 UTC
    pileofrogs++

    I used to administer a shared web server and before I was through, I was writing perl code that identified broken form mail programs, so that I could contact our customers and have them upgrade. My most common upgrade suggestion was to use NMS formmail. If you have to use an email script, that's the one I suggest. It was written by the London Perl Mongers and it works.

    d
Re^2: Questions about sending e-mails
by vit (Friar) on Mar 19, 2009 at 19:32 UTC
    I am going to do something like
    my $msg = MIME::Lite->new( ##From =>'me@myhost.com', To =>xxx@xxx.com', ##Cc =>'some@other.com, some@more.com', Subject =>'Helloooooo, nurse!', Data =>"How's it goin', eh?" ); $msg->send; # send via default
    Just to send message to xxx@xxx.com
    Is it still unsecure?

      Are you actually going to use hard-coded values like in your example? If so, it probably is OK. If not, your example isn't very helpful.

      How do you take info from the web form and turn it into an email?

      --Pileofrogs