Problem using gmail as an smtp

I'm trying to use TeamCity for a college project and have pretty much everything sorted. All I need now is to get the email notification working and I'll be done.

However, I've been trying to set it up using my gmail account as per the instruction here; http://confluence.jetbrains.net/display/TCD4/Setting+up+Google+Mail+and+Google+Talk+as+Notification+Servers

and I've not had any luck thus far. The error message I'm getting is as follows...

javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
  nested exception is:
java.io.IOException: Couldn't connect using "javax.net.ssl.SSLSocketFactory" socket factory to host, port: smtp.gmail.com, 465; Exception: java.lang.reflect.InvocationTargetException

I've checked that SSL is enabled and firewalls have been turned off. But still I can't get the connection to succeed.

Any ideas?

7 comments
Comment actions Permalink

Are there any exceptions in teamcity-server.log?

0
Comment actions Permalink

Just the one I posted above;

[2010-02-09 20:26:16,748]   WARN - ication.email.EMailNotificator - Cannot send email notification: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
  nested exception is:
    java.io.IOException: Couldn't connect using "javax.net.ssl.SSLSocketFactory" socket factory to host, port: smtp.gmail.com, 465; Exception: java.lang.reflect.InvocationTargetException

0
Comment actions Permalink

OK, just realised that a ping to

smtp.google.com

is failing. So it's probably some sort of firewall/blocking issue
I know it's now probably outside the realm of this forum but has anyone got any ideas?

{EDIT} Although this might just be due to te proxy here... hmm.

0
Comment actions Permalink

If you're using an @gmail.com email address, then the port is 465. If you're using a Google Docs account that doesn't end in @gmail.com, then you should point to port 587. Be sure to include the domain as part of the username.

0
Comment actions Permalink

I'm trying the same as announcer, but my only problem that, I've got the same error message:

"javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
  nested exception is:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"

SMTP host

smtp.gmail.com

SMTP port

465

Send email messages from

my@gmail.com

SMTP login

my@gmail.com

SMTP password

mypassword (my generated AppPassword from Google)

Secure connection

SSL

The only difference is that I have 2 factor authentication and I know in that case I have to generate an application password, which I did. But there is no any chance to make it run.
What am I doing wrong?

(I tried it first with my gmail account password but it didn't work, because of the 2 factor auth)

0
Comment actions Permalink

Has anyone found a solution for this?

 

I have this error:

com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.gmail.com, 465; timeout 60000;
  nested exception is:
java.net.ConnectException: Connection timed out: connect

 

Please, can anyone help?

0
Comment actions Permalink

This error seems to mean that there is a connectivity issue with Gmail on port 465, so please double check that.

0

Please sign in to leave a comment.