
Solid, safe website tools.
Whatever your need, Will Bontrager builds powerful software solutions.
|
(Get Attention Ticker for your web site)
Forwarding Email To a ScriptBy Will Bontrager Many hosting companies now provide cPanel or other site management software for their hosting customers to use. These, at least cPanel, make it easy to forward to a script all email sent to a certain address easy relative to manually updating email forwarding configuration files. This post provides a guide to setting up the forwarding and a script you can use for testing. The Email Processing ScriptHere is the testing script: Use a plain text word processor and specify your email address and sendmail location where marked in the script. Use apostrophe characters (single quotes) instead of regular quotation marks when you specify the values. Otherwise, you'll need to escape any @ characters. You may name the script file as you wish, EmailToScriptTest.cgi for example. Upload the script to your server into a directory that can run CGI scripts. Upload with FTP and transfer the file as a text file, not as a binary file. Give the script 755 permissions. Type the URL of the script into your browser. This is to test the script and verify that it does send email. If you receive an email from the script (subject "Email to script test result"), it passed the test. If you do not receive an email from the script, something is wrong. See the "Troubleshooting Email Sent From Scripts" article for some things to check. Once the script passes the test via your browser, set up an email address that redirects to the script. Setting Up Email To Script ForwardingHere is a guide for using cPanel to set it up. (At least one hosting company I know of uses a customized version of cPanel, which can be quite different than this guide.)
When the forwarding has been set up, sending an email to the address being forwarded causes the testing script to respond by sending you an email containing the email it received. If it doesn't, and everything was okay when you tested the script with a browser, the destination is likely to be incorrect. If the destination is certainly correct, there may be email filters somewhere between the testing script and your email program. Your filters may have caught it. Or maybe your ISP's filters did a number on it. Consult the "Troubleshooting Email Sent From Scripts" article again. January 18, 2007 Please note: Articles on this website are presented "as is". However - If you have a question about a CGI script, HTML, CSS, PHP, or JavaScript
Rate this blog post.
No page reload! |
|
|
© 1998-2001 William and Mari Bontrager |
|