Using Gmail or Google Apps email with Magento

I was asked this week by a reader about using Google Apps email with Magento. There are solutions available that will allow you to configure the Magento SMTP server settings, or even your linux server SMTP settings so that you can use Gmail or Google Apps email to send outbound emails with Magento. In this post I will quickly cover a simple little open source Magento extension I made that makes setting up Gmail and Google Apps Email child’s play.

The Google Apps and Gmail Magento extension

You might be wondering firstly why you would want to use Google Apps or Gmail for your outbound emails from Magento.

  • Easier to set up a stable, secure and robust solution than if you try to run your own SMTP server.
  • Easy to administer with either the Gmail or Google Apps interface. You can set up auto replies, and auto forwards.
  • Excellent search capability for finding messages that have been sent to customers.
  • Acts as a log or archive of all emails sent by Magento, which means you can make sure it’s not sending any you do not want sent, and easily track any that are sent.

So hopefully everyone knows how sweet it is using a hosted ‘in the cloud’ email service, now on to how to do it!

Installation

You can install the module from Magento Connect by getting the extension key. Then using your store backend Magento Connect manager, you’ll need to change your settings to accept alpha modules (on the settings tab) and then just paste in the extension key and click install. Too easy. You can change the alpha back to stable afterwards, by the way.

Configuration

The Module is configured in the System -> Configuration -> System section. There are only three things to choose, so it’s very easy to setup.

Using Google Apps or Gmail with Magento is made easy with my purpose built Magento extension.

Using Google Apps or Gmail with Magento is made easy with my purpose built Magento extension.

It’s hopefully redundant, but for completeness here is some documentation:

The Enable Google Apps Email option allows you to turn the extension on and off easily. When enabled the extension will use your supplied Google Apps or Gmail credentials to send email from the Magento store.

The Email Address field is where you type the full address of you Gmail account or Google Apps account. It is important you type the whole address, even for Gmail where you might be more familiar with just entering a username.

Finally the Password field is where you type you Email account password. There is currently no way to test the connection (i.e. to make sure you have the right password) but that is planned functionality for a later release.

The Technical Details

The module is very simple, it’s just two Model files that overwrite the email sending functionality with Magento.

The key is in the setup of the Zend transport object as shown below:

public function getGoogleAppsEmailTransport() {
 
	$email = Mage::getStoreConfig('system/googleappsemail/email');
	$password = Mage::getStoreConfig('system/googleappsemail/password');
 
	$config = array('ssl' => 'tls', 'port' => 587, 'auth' => 'login', 'username' => $email, 'password' => $password);
	$transport = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $config);
 
	return $transport;
 
}

It’s annoying that for all the flexibility Magento allows, the way that the email sending has been coded really doesn’t allow much scope for extending the functionality without re-writing a sizable amount of Magento code. This means that maintenance becomes more difficult and the value of the inheritance structure is lost.

Setting up your Google Apps account

Sign up for a Google Apps account and then you’ll be able to create a ‘user’ to do your Magento email sending. In my current configurations I use email addresses like ‘mailer@xyzdomain.com’ or ‘no-reply@xyzdomain.com’. This means that to the end user the from email address will appear like a sophisticated CRM mailer, when in fact it’s just a free Google Apps account!

I also recommend setting the account up to forward a copy of all email to your own personal Gmail or Google Apps account. This way if any users do actually try to reply to the mailer address, the message will still make it to someone. If you wanted to you could even set up an auto responder that informed users to contact you in a preferred manner.

Feedback

I’d appreciate some feedback on this little module – I know the functionality exists elsewhere, but sometimes just making a good solution really easy for everyone, can be beneficial, hopefully you agree. If you spot any bugs or would like to suggest some new functionality, I’m all ears. Keen readers who check out the source code (which is totally open by the way) may notice I have some code in there for sending test emails, I just haven’t wired it up to the admin interface (backend) yet.

You might also be interested in:

  1. Google Apps Email/Gmail Magento Extension v0.5 released
  2. New feature for Magento Gmail or Google Apps Email Extension
  3. Pre-release: SMTP Pro / Magento Gmail & Google Apps Email Beta testing (win a prize)
  4. Sneak Peek at the New Magento Gmail/Google Apps and SMTP extension
  5. SMTP Pro Magento extension, free and open SMTP support for Magento


Tagged as , , , , + Categorized as Featured, Google Apps Email Magento Extension, Magento, Web Development

99 Comments

  1. Very good idea. nice work and exactly what I am looking for!

  2. sounds like a useful extension, and I am going to install and test it as I use Google Apps with the domain of a website I am building using magento. so will leave so feed back and can help test this.

  3. This extensions sucks and does not work! Fuck you for creating it and fuck you for making me try and get it to work

  4. Thanks for the constructive feedback, I’m sure the open source community is richer for your involvement. If you’d like to describe the problem, I could help you fix it.

  5. Ashley,

    I installed your module on my staging site earlier in the week and it worked just beautifully. Thank you for all your work in making this available! By the time (a day or two later) I moved forward and installed it on my production site, it appears you had released a new version — one with “Use store email addresses” available. I like the idea of this new feature.

    Unfortunately, however, the module doesn’t seem to work at all on my production site, with or without “use store email addresses” enabled. Since the last version worked on an identical site, I suspect the problem is somehow inherent to the changes made. I hope that knowing this will somehow help you in future development of the module.

    In the meantime, is it possible for me to install the previous version?

    Thanks again. I admire and appreciate the contributions you’re making as a developer to the open-source community. Magento wouldn’t be all that useful to the rest of us without you and others who share your spirit.

  6. Also, it may be of use to you to know that when Google Apps does attempt to send an email with the current code installed (which seems to be only sometimes, as I frequently see no activity at all), the emails all seem to be returned with the following error. It may in fact be related to the recipient domain and not the module, but I thought it bore reporting, since the emails sent from the local mail server get through to the same recipient domain without interruption, and it’s only the ones sent through Google Apps that are returned this way. Again, not a problem with the previous release.

    ——

    Google tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 501 501 Malformed RCPT TO: – psmtp (state 17).

  7. You know, after a bit more experimenting, it appears that the reason it wasn’t working at all might have had something to do with the hyphen in the email address I was using. I’ve switched it over to one without and it seems to have made a huge difference. Now only the recipient domain thing is an issue, which I expect probably has nothing to do with your module. So thanks again!

  8. Thanks for the feedback, I’ve sent you an email requesting a bit more info, hopefully if it is a problem with the extension I can get it ironed out.

  9. Do you have an error reporting yet? I have this installed and properly setup but when trying anything that sends email it times out and no email is sent. I’d like to see if I can figure out where the problem is. Does this work in 1.3.2.1? Thanks.

  10. Hi,

    Thanks for trying our my extension. Error reporting/logging is planned for the next release (in a few days) – which will also see the extension tested on 1.3.2.1. As for idnetifiying the problem. Timeouts tend to be caused by firewalls blocking outbound SMTP. If you have ssh access to your host please try:

    telnet smtp.gmail.com 587

    And paste the results back here, it might show what is happening.

  11. Here are the SSH results

    Trying 209.85.147.109…
    Connected to smtp.gmail.com.
    Escape character is ‘^]’.
    220 mx.google.com ESMTP m34sm9823968waf.21

  12. Finally found the info I needed thanks to your great blog, thanks! ^^

  13. I installed. I try both gmail and my apps domain email. Testing on both is the same.


    ASchroder.com Google Apps and Gmail Self-test results
    Testing outbound connectivity to Google:
    Connection to Google SMTP server successful.
    Sending test email to your contact form address lingo@lingoteca.com:
    Unable to send test email. Exception message was: 334 UGFzc3dvcmQ6 …
    Please check and double check your email and password. If in any doubt you can login to the web interface for your email address to confirm at either ‘mail.google.com/a/your_domain’ or ‘gmail.com’.
    Testing failed, please review the reported problems and if you need further help visit ASchroder.com to contact me.

  14. Hi,

    Thanks for trying my extension, have you tried logging in to both accounts using the web interface? Perhaps you got the password wrong and now Google wants you to login to the web interface and solve a captcha to prove you are a human! Otherwise let me know what happens when you try to login through web interface and we can go from there.

    Cheers,
    Ashley

  15. Ignore my previous message. Testing worked. I was running a test before saving configuration. So first thing Save Config then Run Self Test. So installing and testing your extension worked out just fine.

    Now, the problem I am having: somehow when I test the Contact us form, or when I send in an order – admin does not receive any emails. The store owner does not receive and email. Store buyer does receive an email. Any thoughts? Thanks, Fatos

  16. I’ll make that clearer in the next release, thanks for pointing it out. Re: the emails not comin to you, have you configured the appropriate email addrsses in the magento backend?

  17. Hi,

    I installed your extension in my domain – dzipars.lv/magento and it worked like a charm for 2-4 days :D and wolla – nobody get e-mails from day 5. I have ssh acces to server and use Ubuntu Linux 9.04, maybe you can suhhest something and contact me via horninc@gmail.com?
    Ps: test works, no ordinary e-mails are sent.

    TY

  18. Hi! I just wanted to thank you for sharing such an excellent contribution with the Magento community.

    Your extension works flawlessly, and it helps to solve a big problem.

    Best regards,
    Marcus

  19. Hi, Marcus

    Thanks for the feedback, I appreciate it. If there are any features you think would be useful, please let me know – I’m always looking to improve the extension.

  20. Thank your for your ext, It ’s very lovely.
    But Now, I can’t download via connect, please send me via email.
    Thanks

  21. Hello Ashley, Thank you for great extension! I am using it for all outgoing emails and also for newsletter and here I come to a problem with gmail’s limitation of number of sent emails. I got “You have reached a limit for sending mail” message from gmail. Can you help me on how can I limit number of newsletter messages sent per cron job please?

  22. Hi,
    If I have time I’ll look into this in more detail, but it seems if you want a quick fix you should look at the function: sendPerSubscriber in app/code/core/Mage/Newsletter/Model/Queue.php which is called from at least a couple of places: app/code/core/Mage/Newsletter/Model/Observer.php and app/code/core/Mage/Adminhtml/controllers/Newsletter/QueueController.php. I might try and add some configuration for the parameters to an extension – though it seems judging by the source code comments, that configuration around sending is planned.

    If you do make some changes, please let me know I might be able to merge a patch in to help out others with the same problem.

    Cheers,
    Ashley

  23. After I Installed your extention it totally changed the look and feel of the website and added more to every page…. How do I change this back to the design we created???? I need to know ASAP as this functionality was not something I read about in your descriptions and it totally messed up the whole site!!!

  24. I installed everything and the test works fine (connects and sends) to the gmail account, but none of the other emails work. I checked and double checked the Store Email Addresses. Enabled and Disabled the Send Using the Store Email Addresses. Nothing works.

    Please help?!

  25. Enable logging in the Magento admin and check out the log file, my extension will log what it’s doing and that should help find out why the test works and the actual emails do not.

  26. Dear Ashley,

    I use magento version 1.3.2.3 and I installed this extention and then I went to System – Configuration – System.
    In our blog you have said that there are only three things to choose whereas I get four choices which are -
    (i) Enable Google Apps Email
    (ii) Use Store Email Addresses for Reply-to
    (iii) Email Address
    (iv) Password

    I filled in all these choices, and used my mail id sales@syberplace.com which was given to me by google.

    On clicking the self test button I get this message -

    ASchroder.com Google Apps and Gmail Self-test results
    Testing outbound connectivity to Google:
    Connection to Google SMTP server successful.
    Sending test email to your contact form address sales@syberplace.com:
    Unable to send test email. Exception message was: 334 UGFzc3dvcmQ6 …
    Please check and double check your email and password. If in any doubt you can login to the web interface for your email address to confirm at either ‘mail.google.com/a/your_domain’ or ‘gmail.com’.
    Testing failed, please review the reported problems and if you need further help visit ASchroder.com to contact me.

    Can you guide me on how I can fix this problem and make this extension work.

    Thanks
    Shailin

  27. Did you try to log in using the web interface, I have seen that error when Google is trying to present a CAPTCHA to prove you are a human. Let me know if that helps.

  28. Hi Ashley,

    I get the same error as shalin. I use google apps for email. I have checked the user interface that the account is active(went through the captcha activation). Is there any guidance you can provide?

    Thank You:)

  29. Hi, Gil

    I can’t replicate the error with my Google Apps accounts, if you trust me enough you could flick me an email with your username/password and I’ll see if I can replicate the error with your credentials on my test store. If I can then maybe I can figure out what’s wrong. Send me and email or use my contact form if you’d like to give it a try.

    Cheers,
    Ashley

  30. been trying to use the extension but bluehost does not support 587 i tried changing it in the code to 2526 or 465 and no luck. still get an error. can you please help me out.

    Thanks in advance,
    Kris

  31. Sorry mate, that port isn’t chosen for it’s numerology, Google specifies the port, we just have to connect to it. You need to ask you host to stop being so restrictive! Or just get a better Magento host

  32. Hello Ashley, is it possible to disable the google mail for contact form only?

  33. Hi, Not without code modification. You could test for reply-to being set and to=contact form address to and then return super class result, rather than running my method? Can I ask why you want to do that?
    Cheers,Ashley

  34. Shailin & Gil,

    I had the same error. Fatos had the answer for me… that you need to save the config settings before running the self test.

  35. Sorry, that’s catching a few people out now. I’ll add a note under the button in the next release :)

  36. Hello, first of I have to tell you that, I am new to Magento and I am still testing in on my local windows server.

    This is what I get, when I run the self test(both with Enable/Disable Google Apps Email, since I still don’t have Google Apps Email acc),
    using a valid gmail address:

    ASchroder.com Google Apps and Gmail Self-test results
    Testing outbound connectivity to Google:
    Connection to Google SMTP server successful.
    Sending test email to your contact form address hello@example.com:
    Unable to send test email. Exception message was: Warning: stream_socket_enable_crypto() [streams.crypto]: this stream does not support SSL/crypto
    Please check and double check your email and password. If in any doubt you can login to the web interface for your email address to confirm at either ‘mail.google.com/a/your_domain’ or ‘gmail.com’.
    Testing failed, please review the reported problems and if you need further help visit ASchroder.com to contact me.

    Is this error rеlated with the fact, that I am using local windows server, or that I don’t have a G Apps Email account?

    Should I change something in the System -> SMTP setting (only for Windows Server)?

  37. Hi, I Google’d your error and got this thread about HTTPS proxying with Zend. Maybe this relates to your issue? Also the google apps/gmail extension is for use with either an apps account or a gmail account, do you have either of these? If not you should use my SMTP Pro Magento extension. Cheers, Ashley

  38. Hi, thx for the response.

    I still don’t have a Google apps account, that’s why I don’t enable it, and I am using a valid Gmail address, since I have a gmail account.

    I am going to check the 2 links, that U have posted.

    Thx again.

  39. I have just enable the openssl.dll in the php configuration file, and everything works perfect now.

    TY and keep up the good work.

  40. Hi thanks for the app but I am having some trouble. Any help would be great. I put in my working apps account info@mindgamesonline.com.au and my password but I get this error when I run the test. Thanks for any help

    ASchroder.com Google Apps and Gmail Self-test results
    Testing outbound connectivity to Google:
    Failed to connect to Gmail SMTP. Reason: Connection timed out(110)
    This extension requires an outbound SMTP connection on port 587. You need to check if your hosting server blocks outbound TCP connections or SMTP connections on port 587, and if so request access. If you are sure your host supports outbound SMTP on port 587 then something else is preventing a test connection. Please visit ASchroder.com for more information.
    Sending test email to your contact form address info@mindgamesonline.com.au:
    Unable to send test email. Exception message was: Connection timed out…
    Please check and double check your email and password. If in any doubt you can login to the web interface for your email address to confirm at either ‘mail.google.com/a/your_domain’ or ‘gmail.com’.
    Testing failed, please review the reported problems and if you need further help visit ASchroder.com to contact me.

  41. Hi, Ross

    The key in that test result is this:
    “This extension requires an outbound SMTP connection on port 587. You need to check if your hosting server blocks outbound TCP connections or SMTP connections on port 587, and if so request access. If you are sure your host supports outbound SMTP on port 587 then something else is preventing a test connection. Please visit ASchroder.com for more information.”

    And even more key in particular:
    “You need to check if your hosting server blocks outbound TCP connections or SMTP connections on port 587, and if so request access”

    Have you contacted your host about this? You should first confirm that port is able to be connected to. If not, then you should get a better Magento host :)

  42. Thanks working now. Love your work.

  43. Ashley,

    Thanks for your support in the community. I’ve tried a bunch of your extensions and you put up some truly extraordinary work!

    With that said, I have a question to ask :)

    I was hoping I could use this extension to modify the signature line of the emails being sent out: more specifically, I want to add payment information to the Send Order Email Copy To section of the Sales Emails.

    So to recap, an order confirmation email is sent to the customer upon purchase; I would like a copy of this email sent to my supplier with billing information in a signature line, but so far, I cannot find a way to add this. I’ve tried my hosting provider’s Forward and Auto-Responder solutions, but to no avail.

    I no this isn’t necessarily the function you were looking to get out of this extension, but I figured you may be able to point me in the right direction.

    If you might help with where I can enter additional information only to the extra sales copy (even if it’s hard copy payment information, that will be awesome), I’d greatly appreciate any help you can give me.

    Thanks again,

    Dibears

  44. I get the following error with version 0.5
    Unable to send test email. Exception message was: 553-5.1.2 We weren’t able to find the recipient domain. Please check for any …

    any help you can provide is appreciated – thank you for this module, I hope to get it working asap.

  45. That looks like your google account is rejecting the email because the to: address is no good. The to: address for test emails is your contact form address. Check your contact form address is a) set up and b) not got any typos in it.

  46. that was it I had it there wrong.

    thank you!!!!!

  47. sorry 1 more question – the test works great but when someone orders something from the store its still trying to use the postfix

  48. Hi, Hmmm – Is the extension enabled? Have you got another one that might be conflicting?

  49. you were right! I had your SMTP program on there.
    thanks again!

  50. Ashley,

    I’ve installed v0.5 of the Google Apps/Gmail and am getting a 404 when I try the self test. I’ve read all the posts and see that people were having trouble when not saving the settings first. That’s not my problem.

    I’m on Magento 1.3.2.4. Has it been tested on 1.3.2.4?

    Kevin

  51. I can confirm v0.5 of the Gmail/Google Apps Email extension is working on Magento 1.3.2.4, I use that currently combination for one of the stores I run. You could try loging in and out of Magento? Also, please paste the URL that is giving you a 404 error?

  52. Ashley,

    I have logged out and back in of the admin and I still get the 404.

    The URL I see in the browser address bar of the page on which I see the 404 is http://host/magento/index.php/admin/googleappsmailtest/index/index/

    Kevin

  53. That url looks like it’s missing a key, do your other admin urls have a key?

  54. Nope, no keys on any admin URLs.

    Your extension appears to work (thanks by the way). It’s just the self test that’s not working.

    Kevin

  55. Hmm, I think there is a security setting for using admin url keys, I wonder if the self test fails when not using those. If you have time to try it out, please let me know. Otherwise, glad to hear that the actual functionality is working, though I’d hope so – I’m using it in production! :)

  56. I’ve enabled the admin URL keys and still get the 404. Here’s the URL on which I see the 404:
    http://host/magento/index.php/admin/googleappsmailtest/index/index/key/feafaf25c26987c8c20d35d36cef5884/

    Any ideas?

  57. Thanks for following up with these, I have to say, it’s a bit of tricky one eh. Well I have a brand new version of both of my magento email extensions combined into one that I am hoping to release very soon, if you’d like to you could install a pre-release version and beta test it – but I have to warn you, I’m not using it in production yet, and I don’t think others should, it needs some more testing. It does have a self test though, so if you wanted to try a different extension, to see if that change anything, I could send you a copy, let me know? Cheers, Ashley

  58. Hi!

    I face this error when running self-test.

    ASchroder.com Google Apps and Gmail Self-test results
    Testing outbound connectivity to Google:
    Connection to Google SMTP server successful.
    Sending test email to your contact form address ———–:
    Unable to send test email. Exception message was: 535-5.7.1 Username and Password not accepted. Learn more at …
    Please check and double check your email and password. If in any doubt you can login to the web interface for your email address to confirm at either ‘mail.google.com/a/your_domain’ or ‘gmail.com’.
    Testing failed, please review the reported problems and if you need further help visit ASchroder.com to contact me.

  59. Hi, I’ll ask the obvious question first; is the username and password correct? You need to verify it by going to the web interface, here: mail.google.com/a/your_domain and login. If that all checks out, then let me know, it might be something weird with the passwords. Cheers, Ashley

  60. I installed the module and had a successful test. However, none of the emails sent within Magento are being sent through Gmail. I am running Magento version 1.3.2.4.

  61. Ashley,

    Thanks for the offer to try the beta, but I think I’ll wait.

    Kevin

  62. Have you got any other Magento Email extensions installed by any chance? Please try the extension on a fresh install of Magento on the same server/environment – if it still fails let me know and I can help try to diagnose.

  63. nothing ventured, nothing gained :) Keep an eye out for the proper release shortly!

  64. I had your gmail extension working find but suddenly it stopped working and I am getting the out port 587 is closed error. I have spoken to my host and they say port 587 is open. they have asked “Can you give me an address or IP that I can try and connect to on port 587 for Google so I can try and find out what is going on?” What should I tell them??? thanks heaps

  65. Best thing to test for is connectivity direct to the gmail smtp servers at smtp.gmail.com – after all that is what the extension needs to connect to. Let me know how you get on.

  66. Hi Ashley,

    The Gmail apps extension is a great contribution to the community, one thing I noticed is when the plugin gets installed on a unix machine, some of the files don’t get copied into the right places. After installing via magento connect, files were put into /downloader/Z:/home/magento.com/www/app/(code|etc) and they probably should have gone into /app/(code|etc),

    Since they weren’t copied over correctly, from the admin menu you didn’t seen any additional configurations but once they were copied correctly everything showed up as expected.

    Hope that helps.
    -Jeff

  67. thank you thank you! works great. our contact form wasn’t able to send emails to our google apps domain… they just never came through. once i added your extension, our emails were coming through (I think google apps were blocking inbound messages to our domain that had our domain in the “from:” field but were did not use authenticated smtp). Thanks!

  68. Hi, Jeff. That looks more like an issue with the Magento install than with the extension itself, have you tried installing any other extensions and got different results?

  69. Hi Ashley,

    Hey thanks for replying, because of your suggestion that is might be something with the Magento install I took a closer look. Lo and behold I found the pear.ini file was configured improperly due to the fact the Magento install was a copy from another developer… this could have caused headaches in the future.

    Once pear was re-configured everything was golden.

    Thanks for nudging me in the right direction,
    Jeff

  70. Hello thanks again for the gmail app. It was working great until recently when people stopped getting emails from my site. When I ran the test I now get the port 587 is closed message. I have spoken to my host and the assure me the port is open and they are able to contact imap.gmail.com through port 587 on my server. They also say no changes have been made on my server. I have also uninstalled and reinstalled the megento extention but it is still not working. Do you have any other ideas on what problem might be? Thanks in advance. Ross

  71. Hi, Ross

    You need to test connectivity to smtp.gmail.com (not imap) – though if you can get to one, you should be able to get to the other. Also you must test it on the actual server that the extension is running from. If both of those things have been done, and still no emails get sent, then perhaps some security setting in Apache/PHP on your host disallows PHP making outbound connections directly? The emails may still send regardless? Also, do try logging in to gmail/google apps from the web interface google provides, it might be requiring you to enter a captcha (though that error would not cause the connection problems).

    Cheers,
    Ashley

  72. Hi Ashley,

    I have a very ambitious feature request. Wouldn’t it be great if we could somehow using google’s api view google docs, google calender and our google apps mail all from the comfort of our magento admin panel?

  73. That is very ambitious! Plus Google already offers such great web based tools for those services, maybe a better integration would be a mini Magento Dashboard widget for your Google home page – so you can see order status/sales from within your Gogle apps domain?

  74. Hi — I installed this this weekend, and we did get some errors. Customers were getting an “there was an error processing your order” error. When we dug into the code, it appeared orders were going through, but the extension was throwing an error so customers were not getting a “success” message.

    so i turned on logging, ran a transaction, and got this: “exception ‘Zend_Mail_Exception’ with message ‘Subject set twice’ in /home/{{MY MAGE}}/lib/Zend/Mail.php:615″

    /home/{{MY MAGE}}/app/code/community/Aschroder/GoogleAppsEmail/Model/Email/Template.php(58): Zend_Mail->setSubject(’=?utf-8?B?RGVza…’)

    We changed the “Send Order Email Copy Method” from “separate email” to “BCC” and orders began going through again.

    FYI.

  75. this is what is throwing the exception (in the Zend framework)…

    /**
    * Sets the subject of the message
    *
    * @param string $subject
    * @return Zend_Mail Provides fluent interface
    * @throws Zend_Mail_Exception
    */
    public function setSubject($subject)
    {
    if ($this->_subject === null) {
    $subject = $this->_filterOther($subject);
    $this->_subject = $this->_encodeHeader($subject);
    $this->_storeHeader(’Subject’, $this->_subject);
    } else {
    /**
    * @see Zend_Mail_Exception
    */
    require_once ‘Zend/Mail/Exception.php’;
    throw new Zend_Mail_Exception(’Subject set twice’);
    }
    return $this;
    }

  76. Hi Ashley,

    Ive got a weird one, I hope you can help.

    Im using your gmail simple smtp extension (0.5) and the Aheadworks extension product questions. When people send a email it goes into the magento system admin, and I can answer it from the admin. Once I get the question answered and hit send it goes back to the customers email address that they posted. But when they reply back to me it goes to ‘general’ or ‘general@yahoo.com’. I have the setting set to: Use Store Email Addresses for Reply-to [yes].

    Please any help would be greatly appreciated.

    –Thanks,
    Bryan

  77. Hi,
    Sounds like a setting in the product questions extension that must be sending as the ‘general’ contact, either disable the reply-to setting, in which case emails will return to the address that sent them, or check the code of the extension to see if you can make it use a different contact?

    Cheers,
    Ashley

  78. Ashley

    Thanks for your help. I look in the product questions extension and found this line of code in their productquestionscontroller.php file:

    ->setReplyTo(Mage::getStoreConfig(self::XML_PATH_EMAIL_SENDER))

    I removed that and it appears to be working. If it acts up again I will let you know. I posted it here thinking someone else might find this useful as well.

    –Bryan Sammon

  79. Thanks Bryan, I appreciate you reporting back on the solution.

  80. I had a Google Base/Magento problem and your site here steered me to the fix. Glad I found you, and thanks. Cool pics, btw. I hope to see NZ one of these days. Best regards,
    Fred

  81. hi there
    i run self test and email is delivered fine. i set Enable Google Apps Email to YES and emails are still sent from my server postfix not from google apps. I run this test on my fresh development Magento ver. 1.3.2.4. with cache disabled. Any idea what i might be doing wrong?

  82. Not really – but try enabling logging in magento and then run the self test, send a contact form, sign up for the newsletter and create a new order and see what is logged – my extension is written so that it will log out debug if logging is enabled. Let me know what it outputs.

  83. thanx, i dont know why but logging doesnt work on my magento instalations.. maybe something with php settings, anyhow i got extension to work (my fault of course dev magento wasnt as fresh as i thought and there was a small extension that sends invoices as pdf which was was conflicting)
    now it works fine except when i send email from contact us form i get this error
    Fatal error: Call to a member function getName() on a non-object in /magento/app/code/core/Mage/Core/Model/Resource/Setup.php on line 218
    (this time its completely fresh install with nothing changed) – althoug contact-us email is delivered fine even with that error. Thanx

  84. looks like variable from template that is causing error but it has nothing to do with your extension probably… dont worry about that error

  85. Brilliant, thanks for the update. Glad to hear it’s all sorted now.

  86. anybody fammiliar with ASchroder.com Google Apps and Gmail Self-test results
    Testing outbound connectivity to Google:
    Connection to Google SMTP server successful.
    Sending test email to your contact form address k.jahangier@gmail.com:
    Unable to send test email. Exception message was: Warning: stream_socket_enable_crypto() [streams.crypto]: this stream does not support SSL/crypto in C:\xampp\htdocs\magento\lib\Zend\Mail\Protocol\Smtp.php on line 206…
    Please check and double check your email and password. If in any doubt you can login to the web interface for your email address to confirm at either ‘mail.google.com/a/your_domain’ or ‘gmail.com’.
    Testing failed, please review the reported problems and if you need further help visit ASchroder.com to contact me.

  87. It means you don’t have openssl installs. On windows you just enable the openssl.dll in the php.ini configuration file. You may even be able to control it through the XAMP interface?

  88. I`ve OpenSSL and enabled open ssl in the php.ini file and restarted the server.
    http://img402.imageshack.us/img402/8739/openssl.jpg

  89. I am having the same problem (”this stream does not support SSL”) but my server is a unix box. I am hosted with GentoHosting.com

    I’ll have to give them a buzz. Any recommendations on what I should tell them? Is it as simple as enabling with php.ini?

    Thanks

  90. I have to be honest, I haven’t used a windows computer for about 8 years – I’m definitely not the best person to be talking to about this, but I can say the error you get with my extension is related to not having openssl.

  91. if you have a web host, ask them to enable open ssl for php – they should be able to fix it, if not get a better magento host.

  92. Ssl is installed and enabled in php.ini, see picture in my previous post.

  93. I can confirm I have v0.5 running on 1.3.2.4.

    I would suggest making a note, somewhere in the documentation or above the self test link, that you need to save the user/pass first before running the test. It took me forever being an idiot before I realized what I was doing wrong.

  94. Hi,
    Running your extension on my test/development server and it works a treat except for the Contact Us form. I get a ‘contact us unable to submit request’ error.
    This seems to be a known problem in Magento but with no clear fix apart from hacking out the standard smtp code. Any thoughts?

  95. Thanks – this is fixed in the upcoming new release. Stay tuned :)

  96. Hi, are you sure there are no other conflicting extensions?

  97. Hi Ashley
    Not sure if your two previous comments were aimed at me.
    I don’t have any other extensions.
    Are you saying next release will fix the ‘contact us’ form

  98. Hi, Jem – sorry crossed lines – the next release makes it clear you need to save the connection details before running the smtp/gmail self test.

    In terms of the Magento contact form not working – I’d suggest you enable logging and then run through it and send me the logging to see if my extension is even being called and what point it is getting up to in the send process.

    Cheers,
    Ashley

  99. Hi Ashley,

    I set the google App email in SMTP Pro and Google Apps Emails setting extension.
    1. SMTP Pro extension is not working.
    2. Regarding to Google Apps Emails setting, the auto responder is not working and sender is set to hosting email address, not Google App email.

    Would you let me know how auto responder works?

    Best Regards,
    James

Leave a Comment

Name:

Email:

Website:

Sporadic Tweeting...

  • New Post: Why I don’t use Flash, ever (and neither should you NZ Herald): Seriously, just don’t do it – I think I’... http://bit.ly/c9p3p9 6 days ago
  • New Post: A new ASchroder.com for 2010 or, why I haven’t written anything for a couple of weeks…: Tonight I releas... http://bit.ly/91NeAk 1 week ago
  • Don't skip the last session. One of the best is last at #irwd Stephan Spencer was insightful last year. Highly recommended. 3 weeks ago
  • More updates...

What I'm listening to

  • The xx - xx
  • Mos Def - The Ecstatic
  • Jane's Addiction - Nothing's Shocking
  • Florence + The Machine - Lungs
  • Vampire Weekend - Contra
  • Phoenix - Wolfgang Amadeus Phoenix
  • The Temper Trap - Conditions
  • The White Stripes - De Stijl
  • Passion Pit - Manners