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
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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.