Five Stars

cannot send email with tSendMail

hi,
i cannot send message with the conponent tSendMAil.
when i run my job, i have this error that:
xception in component tSendMail_1
javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 25;
  nested exception is:
java.net.SocketException: Permission denied: connect
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1282)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)
at javax.mail.Service.connect(Service.java:275)
at javax.mail.Service.connect(Service.java:156)
at javax.mail.Service.connect(Service.java:105)
at javax.mail.Transport.send0(Transport.java:168)
at javax.mail.Transport.send(Transport.java:98)
at project_test.jobenvoimail_0_1.jobEnvoiMail.tSendMail_1Process(jobEnvoiMail.java:878)
at project_test.jobenvoimail_0_1.jobEnvoiMail.tFileInputProperties_1Process(jobEnvoiMail.java:635)
at project_test.jobenvoimail_0_1.jobEnvoiMail.runJobInTOS(jobEnvoiMail.java:1249)
at project_test.jobenvoimail_0_1.jobEnvoiMail.main(jobEnvoiMail.java:1106)
Caused by: java.net.SocketException: Permission denied: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
at sun.security.ssl.BaseSSLSocketImpl.connect(Unknown Source)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:232)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:163)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1250)
... 10 more
Thank you for your help
7 REPLIES
Six Stars JR
Six Stars

Re: cannot send email with tSendMail

I believe you are using incorrect settings for the SMTP server: https://support.google.com/a/answer/176600?hl=en
smtp.gmail.com does not respond on port 25.
Five Stars

Re: cannot send email with tSendMail

hi, i change the port 25 to 465
i have another error:
Exception in component tSendMail_1
javax.mail.AuthenticationFailedException
at javax.mail.Service.connect(Service.java:306)
at javax.mail.Service.connect(Service.java:156)
at javax.mail.Service.connect(Service.java:105)
at javax.mail.Transport.send0(Transport.java:168)
at javax.mail.Transport.send(Transport.java:98)
at project_test.jobenvoimail_0_1.jobEnvoiMail.tSendMail_1Process(jobEnvoiMail.java:890)
at project_test.jobenvoimail_0_1.jobEnvoiMail.tFileInputProperties_1Process(jobEnvoiMail.java:635)
at project_test.jobenvoimail_0_1.jobEnvoiMail.runJobInTOS(jobEnvoiMail.java:1261)
at project_test.jobenvoimail_0_1.jobEnvoiMail.main(jobEnvoiMail.java:1118)
this the parameter of connection
From=pekrignan@yahoo.fr
To=pekrignan@gmail.com
host=smtp.gmail.com
port=465
emailUsername=pekrignan@yahoo.fr
emailPassword=XXXX
emailSubject=Email Check
EmailMessage=Email Sent Successfully
anyone has an idea
Six Stars JR
Six Stars

Re: cannot send email with tSendMail

As far as I can see, you are trying to log on to a Google account with a Yahoo address. No further comment for now.
Five Stars

Re: cannot send email with tSendMail

anyone has an idea. i cannot send email with tsendMail
Ten Stars

Re: cannot send email with tSendMail

An AuthenticationFailedException means your username/password combination is not being accepted by the server.  As was pointed out, you are attempting to authenticate on a Google mail server with a Yahoo username.  Try authenticating with Google credentials and see if that helps.
Five Stars

Re: cannot send email with tSendMail

i have the same error when i connect gmail to gmail. or password and username are corrects
Six Stars JR
Six Stars

Re: cannot send email with tSendMail

You will need to play around with the settings "SSL Support", "STARTTLS Support" and the SMTP Port and make absolutely sure that you are using valid Google credentials. Did you notice that smtp.gmail.com also listens on port 587?