Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Apr 16, 2010 3:37 am 
Offline
Senior Newbie

Joined: Sat Apr 03, 2010 3:37 pm
Posts: 13
So I really just want to be able to send out a registration e-mail.

I'm still learning but is there someway I can set up google apps to be able to work with the php mail() function or do I need to install something like postfix?


Top
   
 Post subject:
PostPosted: Fri Apr 16, 2010 12:07 pm 
Offline
Senior Newbie

Joined: Thu Feb 18, 2010 1:53 am
Posts: 10
Easier to just setup something like this
http://msmtp.sourceforge.net/
so that it relays it to Google App's for delivery.


Top
   
 Post subject:
PostPosted: Fri Apr 16, 2010 5:09 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
You can also install postfix if you like (handy for receiving emails from the server not from php), you can also PHP's pear module Mail.

I personally use postfix with Mail pear module as a fallback.


Top
   
 Post subject:
PostPosted: Fri Apr 16, 2010 8:20 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
I use SwiftMailer. It can talk to any SMTP server directly, including Google. It doesn't require Postfix to be installed locally when used in this fashion, so there's one less daemon to worry about. It's also a lot more powerful than mail() once you get used to the simple API. You can send multipart messages with embedded attachments and fancy stuff like that. Another option would be PHPMailer.


Top
   
 Post subject:
PostPosted: Fri Apr 23, 2010 2:56 am 
Offline
Senior Newbie

Joined: Tue Mar 30, 2010 11:18 pm
Posts: 10
I just wrote a guide on setting up php mail() to work with msmtp and google apps here. Let me know if it works for you, as I might've left something out. It should work though.

_________________
My blog :3 http://infocalypse-net.info/infocalypse


Top
   
 Post subject:
PostPosted: Mon Apr 26, 2010 8:20 pm 
Offline
Senior Newbie

Joined: Sat Apr 03, 2010 3:37 pm
Posts: 13
Nissy,

Thanks for your guide! I haven't tried yet but I should be setting up my mail this week so will definitely let you know how it goes!


Top
   
 Post subject:
PostPosted: Sun Jul 11, 2010 10:31 pm 
Offline
Newbie

Joined: Sun Jul 11, 2010 8:32 pm
Posts: 3
Nisstyre56,

I went through your steps and worked well for me, just a couple of minor points:

tls_trust_file /usr/share/ca-certificates/mozilla/Thawte_Premium_Server_CA.crt should now be
Equifax_Secure_CA.crt

Also (for other n00bs who also tend to copy and paste code) "sudo chown http /etc/msmtprc" should be "sudo chown www-data /etc/msmtprc" if you've done the default Linode install of Apache.

Thanks though, I've set it up now and works well (except for a problem I was having anyway, which hasn't gone away)


Top
   
 Post subject:
PostPosted: Mon Jul 12, 2010 12:53 pm 
Offline
Senior Newbie

Joined: Tue Mar 30, 2010 11:18 pm
Posts: 10
Glad it worked for you, and yeah, the user would be different depending on your distro. As for your other problem I can't really help considering I don't use Postfix, and that is most likely where the issue is.

_________________
My blog :3 http://infocalypse-net.info/infocalypse


Top
   
 Post subject:
PostPosted: Sat Jul 31, 2010 2:55 pm 
Offline

Joined: Sat Jul 31, 2010 2:53 pm
Posts: 1
Thanks so much for the msmtp guide! Worked perfectly. Just one question though. Is there a way to change the email address it is coming from? Or is this all handled on the gmail side? No matter what address I put in for the from line it comes from my gmail account thats authenticated. This would be fine except I have multiple domains and do not want the mail coming from x.com when y.com is the website thats being used?!? Any help is greatly appreciated.


Top
   
 Post subject:
PostPosted: Sat Jul 31, 2010 4:43 pm 
Offline
Senior Member

Joined: Wed May 13, 2009 1:18 am
Posts: 681
chrisg wrote:
Thanks so much for the msmtp guide! Worked perfectly. Just one question though. Is there a way to change the email address it is coming from? Or is this all handled on the gmail side? No matter what address I put in for the from line it comes from my gmail account thats authenticated. This would be fine except I have multiple domains and do not want the mail coming from x.com when y.com is the website thats being used?!? Any help is greatly appreciated.

Yes, you should be able to do that, but it's a little extra work, since in my experience, the authenticated GMail account has to have been set up with the desired address(es) as an valid alternate address (which is thus verified as belonging to the same person). Otherwise it'll override the From header with the authenticated account. Essentially you're limited to controlling the From: field via the SMTP gateway to the same set of values you can use through the web interface.

So first sign onto the primary GMail account you are authenticating against. Then set up your desired addresses to use as alternate From values in the Settings/Accounts tab (in the "Send Mail As" section). Follow confirmation instructions as usual, which requires being able to receive mail to those accounts, so if you're sending on behalf of someone else you can enlist their help in forwarding over the confirmation message. Then you should be set.

You can't stop Gmail from placing your authenticated address in the Sender: field (which is reasonable, IMO) so if a receiving MUA erroneously decides to show that instead of the From: header you're stuck, but that would be non-compliant behavior on the part of the MUA. Again, no different from choosing a different From: address when sending a message from the web interface.

Note that any from value you give directly to msmtp is just going to get used for the envelope (the SMTP transaction), which aside from potentially showing up in a Received: header is not going to do much for how the mail is seen by people receiving it. You'll want to make sure that your desired address is placed in the From: header in the contents of the message being sent.

For example, in the referenced guide, when doing the test message include the line "From: <youremail@yourdomain>" above the Subject: line and see if that works. Then just arrange for whatever in your application stack composes the contents of the message to include the proper From header.

-- David


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group