Perl CGI Email Primer Tutorial

Perl CGI Email Primer Tutorial

Perl CGI Email Primer Tutorial

Today we again venture into the world of CGI (Common Gateway Interface) on our Apache/PHP/MySql web server, this time to investigate using the Perl CGI to send emails via the Linux sendmail command.

Found with the use of sendmail there are configurations you probably shouldn’t touch, that you should work “with” (rather than against … doh!) … and for advice on this would strongly suggest getting the local web server advice on this via the command perldoc -q “How do I send mail” … would like to say that this idea was dreamed up by yours truly, but yet again, and again, and again, and again, and again (are you getting bored because I’m not … it’s a wet day), and again, and again, and again, and again it was an Open Source (and again) link here that helped. And to get here did this search (notice how CentOS is mentioned … ie. get specific).

This last bit is separate to (and on top of) testing code on a local web server (here we have MAMP for Apache/PHP/MySql Perl CGI) … all these Perl CGIs go through that level of testing first, way before they go to any real web server (would highly recommend this).

Have been meaning for three tutorials now to mention the Apache Error Log (called /Applications/MAMP/logs/apache_error.log here on MAMP (will be different location for other web servers)) which can guide you through Perl CGI (or other brands of CGI) error issues. This makes sense (as a place to look) because the web server (Apache) sits above the CGI code, which sits next to your HTML/(PHP)/Javascript/CSS code, which, today, have the role of providing the HTML form whose action goes to Perl CGI after validation goes through Javascript (remember Javascript Form Validation Primer Tutorial). Have a look at a bit of what such a log looks like here.

Here is a live link for today’s tutorial.

With all Perl tutorials, like Perl and CGI for the World Wide Web by Elizabeth Castro … thanks heaps!

Will leave you with some downloadable programming Perl source code you could call email_sender.cgi supervised by some HTML code containing the calling form called email_sender.html

Anything you want to ask? No? Well … we’ll be off then. Bye for now, and hope you try the live link and enjoy the little mathematical tidbits in the emails.

If this was interesting you may be interested in this too.

This entry was posted in eLearning, Operating System, Tutorials and tagged , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>