floatermule Posted March 3, 2011 Share Posted March 3, 2011 I've just setup an Apache server with a basic LAMP stack. We've decided to use Google Apps (gmail) as our mail server / host. So our ubuntu server is only serving up HTTP files. Because the server is not configured as a mail server, and we're using Gmail for our MX and mail servers, how do I go about using sending out emails via PHP on the Apache Box? I've tried installing Postfix, and configuring using this tutorial, and still a no go. http://www.blogternals.com/2009/04/30/postfix-google-apps-gmail-smtp-relay/ Any Ideas? Quote Link to comment Share on other sites More sharing options...
btherl Posted March 3, 2011 Share Posted March 3, 2011 postfix might be overkill. You would probably do better with a mail library that sends over SMTP directly using whatever SMTP relay Gmail gave you for outgoing mail. Such as this: http://pear.php.net/manual/en/package.mail.mail.factory.php It has an "smtp" back end which won't require any mail software installed on your server. Quote Link to comment Share on other sites More sharing options...
trq Posted March 3, 2011 Share Posted March 3, 2011 Install ssmtp, (see http://linux.die.net/man/8/ssmtp) it is a small sendmail alternative. Config for Gmail would look something like: mailhub=smtp.gmail.com:587 rewriteDomain=yourdomain.com hostname=yourdomain.com UseSTARTTLS=YES AuthUser=user@yourdomain.com AuthPass=userpass FromLineOverride=YES You will likely want to setup a separate email user (done through the Gmail GUI) for your server to use. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.