2013年11月14日星期四

100 Marks for playframework mailing problem .

Site architecture is play 1.2 + japid + morphia

`args String mailContent
$ {mailContent}

This is japid page

application.conf configuration

# 126 configuration
mail.smtp.host = smtp.126.com
mail.smtp.user = xxxxxxxxxxxxxxxxxxxxxx@126.com
mail.smtp.pass = xxxxxxxxxxxxxxxxxxxxxxxx
mail.smtp.channel = ssl
mail.smtp.port = 25
mail.debug = true

send the message controller.
public static void sendTo (String mailsTo) {
setFrom (FROM);
setSubject (SUBJECT_SIGNUP);
addRecipient (mailsTo);
send (CONTENT_SIGNUP_TMP);
}

error
DEBUG: setDebug: JavaMail version 1.4.3
DEBUG: getProvider () returning javax.mail.Provider [TRANSPORT, smtp, com.sun.mail.smtp.SMTPTransport, Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "smtp.126.com", port 25, isSSL false
2013-11-14 13:22:30,889 ERROR [pool-5-thread-1] play.Logger.niceThrowable (568) |

@ 6g9d12cj8
The email has not been sent

Mail error
A mail error occured: Error while sending email

play.exceptions.MailException: Error while sending email
at play.libs.Mail $ 2.call (Mail.java: 186)
at play.libs.Mail $ 2.call (Mail.java: 178)
at java.util.concurrent.FutureTask $ Sync.innerRun (FutureTask.java: 303)
at java.util.concurrent.FutureTask.run (FutureTask.java: 138)
at java.util.concurrent.ThreadPoolExecutor $ Worker.runTask (ThreadPoolExecutor.java: 895)
at java.util.concurrent.ThreadPoolExecutor $ Worker.run (ThreadPoolExecutor.java: 918)
at java.lang.Thread.run (Thread.java: 662)
Caused by: org.apache.commons.mail.EmailException: Sending the email to the following server failed: smtp.126.com: 25
at org.apache.commons.mail.Email.sendMimeMessage (Email.java: 1242)
at org.apache.commons.mail.Email.send (Email.java: 1267)
at play.libs.Mail $ 2.call (Mail.java: 183)
... 6 more
Caused by: javax.mail.MessagingException: Could not connect to SMTP host: smtp.126.com, port: 25;
nested exception is:
java.net.ConnectException: Connection timed out: connect
at com.sun.mail.smtp.SMTPTransport.openServer (SMTPTransport.java: 1706)
at com.sun.mail.smtp.SMTPTransport.protocolConnect (SMTPTransport.java: 525)
at javax.mail.Service.connect (Service.java: 313)
at javax.mail.Service.connect (Service.java: 172)
at javax.mail.Service.connect (Service.java: 121)
at javax.mail.Transport.send0 (Transport.java: 190)
at javax.mail.Transport.send (Transport.java: 120)
at org.apache.commons.mail.Email.sendMimeMessage (Email.java: 1232)
... 8 more
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect (Native Method)
at java.net.PlainSocketImpl.doConnect (PlainSocketImpl.java: 351)
at java.net.PlainSocketImpl.connectToAddress (PlainSocketImpl.java: 213)
at java.net.PlainSocketImpl.connect (PlainSocketImpl.java: 200)
at java.net.SocksSocketImpl.connect (SocksSocketImpl.java: 366)
at java.net.Socket.connect (Socket.java: 529)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect (SSLSocketImpl.java: 570)
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.connect (BaseSSLSocketImpl.java: 141)
at com.sun.mail.util.SocketFetcher.createSocket (SocketFetcher.java: 284)
at com.sun.mail.util.SocketFetcher.getSocket (SocketFetcher.java: 201)
at com.sun.mail.smtp.SMTPTransport.openServer (SMTPTransport.java: 1672)
... 15 more


------ Solution ------------------------------------ --------
  The reply deleted by the administrator

------ For reference only ---------------------------------- -----
I can use at home , why is the company running on the wrong ? ?


------ For reference only ---------------------------------- -----


say ah , there may be a network problem , you need to use the Internet company code?
------ For reference only -------------------------------------- -
     
  
say ah , there may be a network problem , you need to use the Internet company code?  

code and configuration no problem
------ For reference only ----------------------------- ----------
resolved, ask colleagues need agent ! Thank moderators

没有评论:

发表评论