This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer Study Guide: Exam 1Z0-830 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Log4J authentication error with SMTPAppender

 
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
Sheriff
Posts: 28328
96
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
A wop bop a lu bop a womp bam boom! Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic