Jump to content

outgoing mail function / postfix / gmail?


floatermule

Recommended Posts

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

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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.