File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Log4J authentication error with SMTPAppender

 
Peter Primrose
Ranch Hand
Posts: 755
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
howdy

I'm trying to send fatal messages to my email and I keep getting the error below:

I take it the system requires authentication. What line should I add to the log4j.properties in order to solve it?

my log4j.properties looks like this:

log4j.appender.MAIL=org.apache.log4j.net.SMTPAppender
log4j.appender.MAIL.Threshold=FATAL
log4j.appender.MAIL.BufferSize=10
log4j.appender.MAIL.From=info@syntac.com
log4j.appender.MAIL.SMTPHost=outgoing.verizon.net
log4j.appender.MAIL.Subject=Log4J Message
log4j.appender.MAIL.To=info@syntac.com

log4j.appender.MAIL.layout=org.apache.log4j.PatternLayout
log4j.appender.MAIL.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n



the ERROR:



log4j:ERROR Error occured while sending e-mail notification.
javax.mail.SendFailedException: Sending failed;
nested exception is:
class javax.mail.MessagingException: 530 authentication required - for help go to http://help.yahoo.com/help/us/bizmail/pop/pop-11.html

at javax.mail.Transport.send0(Transport.java:218)
at javax.mail.Transport.send(Transport.java:80)
at org.apache.log4j.net.SMTPAppender.sendBuffer(Unknown Source)
at org.apache.log4j.net.SMTPAppender.append(Unknown Source)
at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:230)
at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:65)
at org.apache.log4j.Category.callAppenders(Category.java:203)
at org.apache.log4j.Category.forcedLog(Category.java:388)
at org.apache.log4j.Category.fatal(Category.java:362)
at MyTest.main(MyTest.java:16)
log4j:ERROR Error occured while sending e-mail notification.
javax.mail.SendFailedException: Sending failed;
nested exception is:
class javax.mail.MessagingException: 530 authentication required - for help go to http://help.yahoo.com/help/us/bizmail/pop/pop-11.html

at javax.mail.Transport.send0(Transport.java:218)
at javax.mail.Transport.send(Transport.java:80)
at org.apache.log4j.net.SMTPAppender.sendBuffer(Unknown Source)
at org.apache.log4j.net.SMTPAppender.append(Unknown Source)
at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:230)
at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:65)
at org.apache.log4j.Category.callAppenders(Category.java:203)
at org.apache.log4j.Category.forcedLog(Category.java:388)
at org.apache.log4j.Category.fatal(Category.java:362)
at MyTest.main(MyTest.java:17)
log4j:ERROR Error occured while sending e-mail notification.
javax.mail.SendFailedException: Sending failed;
nested exception is:
class javax.mail.MessagingException: 530 authentication required - for help go to http://help.yahoo.com/help/us/bizmail/pop/pop-11.html

at javax.mail.Transport.send0(Transport.java:218)
at javax.mail.Transport.send(Transport.java:80)
at org.apache.log4j.net.SMTPAppender.sendBuffer(Unknown Source)
at org.apache.log4j.net.SMTPAppender.append(Unknown Source)
at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:230)
at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:65)
at org.apache.log4j.Category.callAppenders(Category.java:203)
at org.apache.log4j.Category.forcedLog(Category.java:388)
at org.apache.log4j.Category.fatal(Category.java:362)
at MyTest.main(MyTest.java:18)
 
Paul Clapham
Sheriff
Pie
Posts: 20171
25
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The SMTPAppender doesn't support authentication. You can tell that by looking at its API documentation and noticing that there aren't any "setXXX" methods related to authentication.

You could write your own subclass that does support authentication. Or you could do what it looks like the authors intended and use a local server. I find it hard to imagine an application that must e-mail error notifications but isn't running in an environment that doesn't have its own SMTP server.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic