У меня проблема. Я пытаюсь написать приложение для моего регистратора, который должен отправить электронное письмо из приложения. Это мой файл log4j.properties:
log4j.rootLogger=WARN, console, EMAIL
....
log4j.appender.EMAIL=org.apache.log4j.net.SMTPAppender
log4j.appender.EMAIL.SMTPProtocol=smtp
log4j.appender.EMAIL.Threshold=ERROR
log4j.appender.EMAIL.SMTPPort=25
log4j.appender.EMAIL.SMTPUsername=**
log4j.appender.EMAIL.From=**@**.pl
log4j.appender.EMAIL.SMTPPassword=**
log4j.appender.EMAIL.To=**@**.pl
log4j.appender.EMAIL.SMTPHost=smtp.**.pl
log4j.appender.EMAIL.Subject=Test Smtp
log4j.appender.EMAIL.layout=org.apache.log4j.PatternLayout
log4j.appender.EMAIL.layout.ConversionPattern=[%d] [%t] %-5p %c %x - %m%n
log4j.appender.EMAIL.smtp.starttls.enable=false
log4j.appender.EMAIL.smtp.auth = true
log4j.appender.EMAIL.BufferSize=1
, и я получаю это:
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.**.pl", port 25, isSSL false
log4j:ERROR Error occured while sending e-mail notification.
javax.mail.MessagingException: Could not connect to SMTP host: smtp.**.pl, port: 25;
nested exception is:
java.net.ConnectException: Connection timed out: connect
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1934)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638)
at javax.mail.Service.connect(Service.java:317)
at javax.mail.Service.connect(Service.java:176)
at javax.mail.Service.connect(Service.java:125)
at javax.mail.Transport.send0(Transport.java:194)
at javax.mail.Transport.send(Transport.java:124)
at org.apache.log4j.net.SMTPAppender.sendBuffer(SMTPAppender.java:330)
at org.apache.log4j.net.SMTPAppender.append(SMTPAppender.java:215)
at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
at org.apache.log4j.Category.callAppenders(Category.java:206)
at org.apache.log4j.Category.forcedLog(Category.java:391)
at org.apache.log4j.Category.error(Category.java:322)
Кто-нибудь может мне помочь?