17 Replies Latest reply: Oct 22, 2014 6:24 PM by Himansu Sekhar Khuntia RSS

    gmail smtp mail server verification

    waynefdavies Community Member

      I have lately upgraded to CF10 from CF9.

       

      Just lately I have noticed that I cannot get gmail smtp mail server verification within CFAdmin.

       

      I am using the same settings as before.  In fact, on an old machine using CF9 I still get mail server verification.

       

      MAIL SERVER: smtp.gmail.com

      USERNAME: name@gmail.com

      PASSWORD: xxxxxxxxxx

      SERVER PORT 25

      x  Enable SSL socket connections to mail server

       

      Any insight would be greatly appreciated!

       

        wayne

        • 1. Re: gmail smtp mail server verification
          Charlie Arehart CommunityMVP

          Is there any error in any of the CF logs, at the time you try that verification? It may give more details to help you understand the problem. (I have not tried verifying such a gmail connection myself.)

           

          /charlie

          • 2. Re: gmail smtp mail server verification
            waynefdavies Community Member

            I went through all the logs but could find no relevant error at the time of verification.

             

            However, when I send a trial message from my form then this error can be found in mail.log

             

            "Error","scheduler-1","04/13/13","09:15:26",,"javax.mail.AuthenticationFailedException: 535 No SMTP server defined. Use real server address instead of 127.0.0.1 in your account. "

             

            I can assure you that I have set the mailserver/password etc to smtp.gmail.com

             

            I am using IIS as well though, and I notice that within its gui there is an SMTP email area.( I did play around with various option within here, but still could not connect and received the same error)

             

            Any help would be greatly appreciated!

             

            Wayne

            • 3. Re: gmail smtp mail server verification
              Charlie Arehart CommunityMVP

              Wayne, a few thoughts.

               

              First, you mention your CF9 being on an “old machine”. So this CF10 is on a new machine, right? Could it be a firewall issue perhaps? Got on the server (the CF10 one) and go to the Windows command prompt (Start>Run>cmd) and do:

               

              telnet smtp.gmail.com 25

               

              if that fails, then the problem is not CF.

               

              But let’s assume that may work. In that case, second, do note that the CF Admin mail setting sets a default, if you don’t set one on a CFMAIL tag in a page. You should find the CFML code for that form to locate the CFMAIL tag, and determine if it has its own SERVER attribute.  If so, you need to change that to use gmail as well, then.

               

              Third, if you find that it does NOT have a SERVER attribute, then that page will indeed rely on the CF admin setting. And if you will still swear that it’s right, my only other thought is I wonder if you may have more than one instance of CF, and you configured the CF admin for one instance, but this code is running in the context of another. You can do a CFDUMP var=”#server#” to see what instance the request is running within.

               

              Let us know what you find.

               

              Finally, the existence of the optional IIS SMTP server is of no consequence here, if indeed you are telling CF to use gmail.

               

               

               

              /charlie

              • 4. Re: gmail smtp mail server verification
                Charlie Arehart CommunityMVP

                Oh, and I had meant to add as well: if you remain challenged, you may also want to consider the info in the page (from google) on troubleshooting gmail connections: http://support.google.com/mail/answer/78775?hl=en

                 

                It also notes that besides port 25 (which should work for SSL connections, and I know you said worked on the old machine), you can also use port 465 for SSL, and you would use port 587 for TLS. I assume you are saying you have checked the "use ssl" and not the "use tls" option in the CF admin (and that you are also not overriding either of these in a way that would conflict, in the CFMAIL tag of the page in question.)

                • 5. Re: gmail smtp mail server verification
                  waynefdavies Community Member

                  Ok.. so I ran the telnet smtp.gmail.com 25 command and I then had this displayed:

                   

                  220 mx.google.com ESMTP s10sm18405066yho.13 - gsmtp

                   

                  which I have to confess I didn't know the meaning of ... but after searching a bit I think it confirms that I do NOT have a firewall problem?

                   

                  Wayne

                  • 6. Re: gmail smtp mail server verification
                    Charlie Arehart CommunityMVP

                    That does indicate that you can connect to that server and port. You’re confirming that was from on the server running CF 10, right?

                     

                    And if so, what about all the other things I had offered? I’m really trying to help, but you need to help us help you.

                     

                    /charlie

                    • 7. Re: gmail smtp mail server verification
                      waynefdavies Community Member

                      I double checked the code and there are no server attributes in the cfmail tag.

                       

                      I also went through the troubleshooting gmail page link, and noted that everything was set correctly already.

                       

                      I did a <cfdump var="#server#"> addition, and this is what was returned:

                       

                      struct
                      coldfusion
                      struct
                      InstallKitNative Windows
                      appserverJ2EE
                      expiration{ts '2013-04-13 09:07:57'}
                      productlevelDeveloper
                      productnameColdFusion Server
                      productversion10,0,9,284568
                      rootdirC:\ColdFusion10\cfusion
                      supportedlocalesChinese (China),Chinese (Hong Kong),Chinese (Taiwan),Dutch (Belgian),Dutch (Standard),English (Australian),English (Canadian),English (New Zealand),English (UK),English (US),French (Belgian),French (Canadian),French (Standard),French (Swiss),German (Austrian),German (Standard),German (Swiss),Italian (Standard),Italian (Swiss),Japanese,Korean,Norwegian (Bokmal),Norwegian (Nynorsk),Portuguese (Brazilian),Portuguese (Standard),Spanish (Mexican),Spanish (Modern),Spanish (Standard),Swedish,ar,ar_AE,ar_BH,ar_DZ,ar_EG,ar_IQ,ar_JO,ar_KW,ar_LB,ar_LY,ar_MA,ar_OM,a r_QA,ar_SA,ar_SD,ar_SY,ar_TN,ar_YE,be,be_BY,bg,bg_BG,ca,ca_ES,cs,cs_CZ,da,da_DK,de,de_AT,d e_CH,de_DE,de_LU,el,el_CY,el_GR,en,en_AU,en_CA,en_GB,en_IE,en_IN,en_MT,en_NZ,en_PH,en_SG,e n_US,en_ZA,es,es_AR,es_BO,es_CL,es_CO,es_CR,es_DO,es_EC,es_ES,es_GT,es_HN,es_MX,es_NI,es_P A,es_PE,es_PR,es_PY,es_SV,es_US,es_UY,es_VE,et,et_EE,fi,fi_FI,fr,fr_BE,fr_CA,fr_CH,fr_FR,f r_LU,ga,ga_IE,hi_IN,hr,hr_HR,hu,hu_HU,in,in_ID,is,is_IS,it,it_CH,it_IT,iw,iw_IL,ja,ja_JP,j a_JP_JP_#u-ca-japanese,ko,ko_KR,lt,lt_LT,lv,lv_LV,mk,mk_MK,ms,ms_MY,mt,mt_MT,nl,nl_BE,nl_N L,no,no_NO,no_NO_NY,pl,pl_PL,pt,pt_BR,pt_PT,ro,ro_RO,ru,ru_RU,sk,sk_SK,sl,sl_SI,sq,sq_AL,s r,sr_BA,sr_BA_#Latn,sr_CS,sr_ME,sr_ME_#Latn,sr_RS,sr_RS_#Latn,sr__#Latn,sv,sv_SE,th,th_TH, th_TH_TH_#u-nu-thai,tr,tr_TR,uk,uk_UA,vi,vi_VN,zh,zh_CN,zh_HK,zh_SG,zh_TW
                      os
                      struct
                      additionalinformation[empty string]
                      archamd64
                      buildnumber[empty string]
                      nameWindows 7
                      version6.1

                       

                      Thanks again for all your help... I really do appreciate that it takes a lot of your time!

                       

                      Wayne

                      • 8. Re: gmail smtp mail server verification
                        Charlie Arehart CommunityMVP

                        Thanks for the confirmations, and the kind regards. I’m afraid I’m out of ideas at this point. Hopefully someone else may be able to help.

                         

                         

                         

                        /charlie

                        • 9. Re: gmail smtp mail server verification
                          waynefdavies Community Member

                          Just a note here on this same subject.

                           

                          Using coldfusion 9 I can easily connect to the gmail smtp server within coldfusion admin.  Then I can successfully send out mail from within my application.

                           

                          Using exactly the same code/database etc on another (newer) computer I cannot connect to the gmail smtp server using coldfusion 10, and obviously cannot send out mail.

                           

                          Fortunately it is easy to work around this problem by keeping the old computer database up do date, but I am curious still as to why coldfusion 10 doesn't connect?

                           

                            Wayne

                          • 10. Re: gmail smtp mail server verification
                            vishu#13 Community Member

                            Hi

                             

                            Configure gmail with outlook and then try the settings mentioned below in CF 10 admin, then it will definitely work

                             

                            Mail Server : smtp.gmail.com

                            Username : abc (do not add @gmail.com)

                            Password :

                             

                            Server port : 587

                             

                            Check : Enable TLS connection to mail server

                            Check : Verify mail server connection

                             

                            Thanks

                            VJ

                            • 11. Re: gmail smtp mail server verification
                              waynefdavies Community Member

                              Dear VJ

                               

                              Thanks for your help here!

                               

                              Unfortunately when I use the parameters above I still get a connection failure.

                               

                              If I use port 25 I now can get a server connection, but then I get the error

                               

                              "com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first"

                               

                              Cheers, Wayne

                              • 12. Re: gmail smtp mail server verification
                                vishu#13 Community Member

                                Is your gmail account which you are trying to configure in CF set up in outlook (if you are using outlook in your machine)?

                                • 13. Re: gmail smtp mail server verification
                                  waynefdavies Community Member

                                  Dear VJ

                                   

                                  No it is not, I am just using a "normal" gmail account in a browser.

                                   

                                  I don't have outlook in my machine.

                                   

                                  Cheers, Wayne

                                  • 14. Re: gmail smtp mail server verification
                                    vishu#13 Community Member

                                    Wayne,

                                     

                                    I did run the into same issue. Later on, I installed Office in my machine, configure Outlook with gmail account and then configure the same gmail account in coldfusion and it worked for me.

                                     

                                    Wayne, the resolution which I shared is the one which I found for myself. So, it might not be a desired resolution. If possible, try the same and then observe the behaviour.

                                     

                                    Thanks

                                    VJ

                                    • 15. Re: gmail smtp mail server verification
                                      Himansu Sekhar Khuntia Community Member

                                      Hello Wayne,

                                       

                                      If you haven't got the solution yet, give it a try.

                                      Allowing less secure apps to access your account in gmail (https://www.google.com/settings/security/lesssecureapps).

                                      Enabling access for less secure apps solved similar issue for me.(Make sure you don't have 2-Step Verification enabled for your accounts while allowing less secure apps to your account.)

                                       

                                      Thanks

                                      Himansu

                                      • 16. Re: gmail smtp mail server verification
                                        waynefdavies Community Member

                                        Himansu

                                         

                                        Thanks so much for looking further into this for me.

                                        I never did achieve success with my original problem, and I "solved" it when I upgraded to a new laptop just recently.

                                        I have found, on Windows 8.1, that using either Apache server or the stand alone ColdFusion server connects with the gmail  smtp mail server without much ado.

                                         

                                        I don't know very much about these problems, but I suspect that Windows IIS security was at the root of my problem before.

                                         

                                        Cheers, Wayne

                                        • 17. Re: gmail smtp mail server verification
                                          Himansu Sekhar Khuntia Community Member

                                          Thanks for the clarification Wayne.

                                           

                                          Regards Himansu