Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have my site set up and functioning on a vps. The domain is on godaddy. The nameservers point at godaddy then i have set the a record to point at the IP of the VPS and its working fine. I now need to set up email for this. My site sends various emails to me when certain things happen and i also have email accounts set up for users e.g. These all worked when i had shared hosting but now i need to set it up myself.

The VPS is using centos with apache,sql and php running the website.

I have looked at google apps for business to run this but i want to be able to send emails using php along with hosting email accounts for admins of the site.

share|improve this question

migrated from May 30 '14 at 14:36

This question came from our site for professional and enthusiast programmers.

save your self the hassle and have WHM/Cpanel installed – cmorrissey May 30 '14 at 13:55
i cant afford to be paying for cpanel as much as i would like it – Dan Hastings May 30 '14 at 13:55
I would just google "how to setup mail server on centos". You will need to install some mailer software on your server, configure DNS records and link php/apache into the mailer software. – Nicholas Young May 30 '14 at 13:59
Offtopic. Not a programming question. This is server/dns configuration. Try superuser and/or serverfault – Marc B May 30 '14 at 13:59
ISPConfig is fairly easy to use as well and it's free. – mtak May 30 '14 at 14:50

You mentioned Google Apps, which is a viable solution. You would set your domain's MX records to point to Google (they have instructions for that), and for sending, you would simply configure your PHP application to use your Google Apps mail account's credentials. Emails will appear to be sent from the Google Apps account.

The other option is you can install a mail agent on your VPS. Good choices include Postfix and Sendmail, which are in the CentOS repo. Configuring these to receive mail is a lot more difficult than simply using Google Apps (or another hosted solution) but doable; configuring them to send mail is easy, but likely unreliable as you'll probably be blocked by your recipients' spam filters. It is better to rely on someone else to deliver your mail.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.