CGI Email Script

by Hiroshi on 09-04-2008

Sometimes we have to work with servers which do not support PHP or other languages other then CGI. And we know how much email facility is important for a website!

So for this case here is the CGI emailing script which will send a detailed email.

This example uses three files.

1- One html form page that contains path to cgi script and also a hidden mail field to which mail is to be sent.
2- Configuration file which contain email address and cgi script.
3- Cgi mail script will also contain these lines which is path to sendmail and email.conf file path.
my $sendmail = "/usr/sbin/sendmail";
my $emailConfPath = "/home/javedk/public_html/cgi-bin/email.conf";

In emailconfpath javedk is user of server rest of thing will remain same and email.conf is the file name which is located in the cgi-bin.

Upload html in root and conf and sendMail files in cgi-bin directory. Also keep CHMOD 755 to ensure keep it excutable.

Download full example of CGI Mail Form

  • Share/Save/Bookmark

Stumble it Digg it Bookmark it Tweet it Share at Facebook

Related Posts

Post a Comment

Comment will appear here after approval, Thanks for patience