Welcome Guest | Login

Google Apps and Sending Emails from Scripts

I have the mx recrods for my email of my domain going to Google apps and I'm currious to know how that would effect my ability to send emails from a php script or a ruby on rails application. I wouldn't think it would affect anything for php. I'm not too knowledgeable with sending Emails via ruby on rails so I'm not sure how how that would really work. Does anyone have the same configuration or does anyone know if scripting is the same with or without google apps handling my email.

Thanks,
Tony

2007-02-09 06:48 PM

Hey Tony, you should be able to use sendmail no problem with ActionMailer

at the bottom of your environment.rb put just

   ActionMailer::Base.delivery_method = :sendmail  
   ActionMailer::Base.perform_deliveries = true  


you can also add

   ActionMailer::Base.raise_delivery_errors = true  
   ActionMailer::Base.default_charset = "utf-8"

if you want...

Cheers,

~William

2007-02-10 05:52 AM

ahh thanks! I was wondering about. I'm just now getting to the chapter about sending email in the agile book.

2007-02-10 01:56 PM

I have been working on a shopping cart using Zen Cart and I need to send emails out. I have google apps for my email and for the life of me I can't figure out how to configure it so that it will send them. I believe my MX records are set to Google Apps so I tried using sendmail as one of the options. That hasn't worked.

I tried using smtp doing the whole smtp.google.com and then using port 465. That hasn't worked either. This is the ONLY thing holding me up from delivering to my client. Any suggestions here as to what I might be doing wrong?

I have been reading this forum post:http://www.zen-cart.com/forum/showthread.php?t=48000&page=5&highlight=Google+Apps

The only thing I could think of is that the mx records aren't set up right but I don't htink so cause I can send and recieve email from google apps.

2007-02-15 07:31 PM

Hmmm - tough one - I wish I had more experience with Zen Cart to help you out.

Can you walk me through exactly how you have set up email with your app and how its supposed to work?  Maybe it'll help.  

I noticed someone on that forum said "My problem is fixed. Appears I have to use PHP as the Email Transport."  -- not sure what he means (because mail() just uses sendmail) - do you know what he's getting at?

There are probably many ways to fix this - so let me know and I'll help as I'm able with my limited PHP background...

~William

2007-02-16 03:01 AM

okay cool. Here I'll email you a screen shot to support that give you a bit of background on what the interface looks like. But for example, if you were to install zen cart and log into your admin interface and then go to:

Configuration -> Email Options -> E-Mail Transport Method

Then you'll be given this list:
--------------------------------------------------------------------------------
E-Mail Transport Method
Defines the method for sending mail.
PHP is the default, and uses built-in PHP wrappers for processing.
Servers running on Windows and MacOS should change this setting to SMTP.

SMTPAUTH should only be used if your server requires SMTP authorization to send messages. You must also configure your SMTPAUTH settings in the appropriate fields in this admin section.

sendmail is for linux/unix hosts using the sendmail program on the server
"sendmail-f" is only for servers which require the use of the -f parameter to send mail. This is a security setting often used to prevent spoofing. Will cause errors if your host mailserver is not configured to use it.

Qmail is used for linux/unix hosts running Qmail as sendmail wrapper at /var/qmail/bin/sendmail.
------------------------------------------------------------------------------

So the guy who got this working chose "sendmail" and then left his smtp (which you'll see from the screen shot I'm sending you) info empty. He had his MX records set for google apps. So this guy got it working for him so it's gotta work. I'm either missing something in the configuration menu OR somehow the email for that domain is set up wrong. Either way it's 1am and I'm SOL'ed for right now until we figure this out. LOL!!! *I'm starting to think that using a prebuild solution isn't always the best thing*

2007-02-16 03:13 AM

These emails have to be going to some place because I'm not getting an error saying they weren't delivered. Is there a way to find out where those emails are going and seeing if I'm actually sending out emails from the glo-techinc.com domain?

2007-02-16 03:31 AM

Yeah I got your screenshot and took a look at the logs.  

2007-02-15 15:41:45 1HHoML-0001zQ-6V ** admin@<YOURDOMAIN>.com R=virtual_aliases: No Such User Here

Have you set up the admin mailbox in your cPanel?  

Reply to the ticket with other emails I can look at.....(the to and the from..)
~William

2007-02-16 03:44 AM

And BTW the MX records will only deal with incoming mail....

2007-02-16 03:45 AM

Just so others can benefit from this thread if they should ever run into this. I had set up the Emails on Google Apps side but did not set those up in cPanel. Once I did that it resolved the issue.

2007-02-16 11:06 AM

Hello,

So (re: the last post) to create email addresses in Google Apps, even though the MX records for your domain are set to Google Apps, you have to create the email address in your cPanel here at HostingRails first?

I'm wondering about all of this as well.  I would like to use Google Apps with my domain, but I'm unsure of how that will affect my ability to send emails via rails.  Part of my ActionMailer setup in environment.rb is:

ActionMailer::Base.smtp_settings = {
   :address => "mail.mydomain.com",
   # other stuff
}

Should I switch the address paramter to the Google Apps address, or leave it as is?  Also, I have:

ActionMailer::Base.delivery_method = :smtp

Should :smtp be changed to :sendmail when I make the switch?

Thanks!

2008-04-03 08:21 PM

Hi ,

Once you have changed your MX record of your domain to Google - you need not create any email accounts on the server from the cPanel.

>Should :smtp be changed to :sendmail when I make the switch?

We suggest you to use sendmail since we have seen many users having issues with smtp settings.

2008-04-03 08:53 PM

HostingRails Support
Thanks Kumar.  But your last sentence leads me to one more question:  should I be using sendmail all of the time, or only if I start using Google Apps?  Would it be beneficial for my site even before I switch if I change :smtp to :sendmail?

2008-04-03 09:02 PM

Cilphex - I think that's unpredictable and depends totally on your app and environment. You should try the switch first to see how they would be affecting your emails.

2008-04-03 11:17 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.