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? Link to comment https://forums.phpfreaks.com/topic/229444-outgoing-mail-function-postfix-gmail/ 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. Link to comment https://forums.phpfreaks.com/topic/229444-outgoing-mail-function-postfix-gmail/#findComment-1182174 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 [email protected] AuthPass=userpass FromLineOverride=YES You will likely want to setup a separate email user (done through the Gmail GUI) for your server to use. Link to comment https://forums.phpfreaks.com/topic/229444-outgoing-mail-function-postfix-gmail/#findComment-1182175 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.