Setting up email for use with PHP applications

If your web application requires emails to be sent out from your web server for such things as sending download information, login information and so on, then you will need to set up some email accounts on your hosting system. This is particularly true for an application such as PHP-eSeller where it is important for the emails to be sent out correctly and reach their destination without ending up in the spam folder.

Log into your hosting account where you set up your databases and administer your web hosting. Normally this will be using cpanel which will look something like this:

You should see a section identified as “Mail”.

You need to set up an email account, so click on the link for “Email accounts” which will take you to a display where you create an account with a user name and password for your domain.

Enter in an email account name. For my applications I normally create an admin account so this will become admin@myservername.com. You also need to enter in a password which you should should keep a record of.

Now that you have created your account, your hosting will provide you with a link to a web mail client where you can login and then see your emails. You may want to send a test email to your account from hotmail or yahoo just to see how it works.

Now that you have an email account set up, you can use this in your PHP applications.

There is one other step that you may want to do, and that is to redirect this email to one of your other accounts. This will mean that when someone emails admin@yourservername.com, it will appear in your hotmail or yahoo account.

To do this, in cpanel under the “Mail” section, click on the link called “Forwarders”. Click on the button called “Add Forwarders” which will take you a page that will look something like:

Leave a Reply