Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.)
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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 |
| ||||||||||||||||||
os |
|
Thanks again for all your help... I really do appreciate that it takes a lot of your time!
Wayne
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Is your gmail account which you are trying to configure in CF set up in outlook (if you are using outlook in your machine)?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Thanks for the clarification Wayne.
Regards Himansu