Consejos para el desarrollo Web, estrategias de marketing y novedades de A2 Hosting enviadas a su email.
cPanel allows you to set up e-mail forwarders that pipe incoming e-mail messages to a script file. You can then program a script file to automatically process the incoming messages however you want.
The following languages are currently supported for e-mail forwarder scripts:
When you set up a script, there are two things you must do to make sure the forwarder functions correctly:
Set the correct file permissions for the script: To do this, type the following command, replacing scriptfile with the script filename:
chmod 755 scriptfile
If there are any configuration errors in the forwarder or in the script file, the message sender receives the following message:
Mail delivery failed: returning message to sender
Additionally, this return message may list errors that contain code fragments from the script file. Make sure you test your script file thoroughly before you use it with an active e-mail forwarder!
The following PHP code sample shows one way to process an incoming e-mail message. The script simply reads the message from stdin, and then stores the message text in a variable named $message:
#!/usr/bin/php -q 1024 ); } fclose( $fd ); // The $message variable now holds the entire message text, // which you can use for further processing. ?>
To add an e-mail forwarder that redirects to a script file, follow these steps:
Subscribe to receive weekly cutting edge tips, strategies, and news you need to grow your web business.
No charge. Unsubscribe anytime.