You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Sumit Kumar <su...@novell.com> on 2005/04/04 16:17:21 UTC

error while sending mail to gmail (must issue a starttls command)

Hi,

I am getting this exception error while sending mail to gmail server.
(smtp.gmail.com).

log4j:ERROR Error occured while sending e-mail notification.
javax.mail.SendFailedException: Sending failed;
  nested exception is:
        class javax.mail.MessagingException: 530 5.7.0 Must issue a
STARTTLS command first

        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
com.novell.nrm.logger.SMTPAppender.append(SMTPAppender.java:361)
        at
org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:221)
        at
org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:57)
        at org.apache.log4j.Dispatcher.run(AsyncAppender.java:310)

While searching on the net I found that I should set the starttls
property as
property.put("mail.smtp.starttls.enable","true");

But even that doesn't help me. Can any one help me to get it working
with gmail server ?

Would appreciate any help ...
Thanks in Advance.
Sumit


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Re: error while sending mail to gmail (must issue a starttls command)

Posted by Paul Smith <ps...@aconex.com>.

>While searching on the net I found that I should set the starttls
>property as
>property.put("mail.smtp.starttls.enable","true");
>
>  
>
Where do you make this call?  You'll need to set it as a System property 
BEFORE the SMTPAppender is configured, as it creates the Properties 
bundle during activation: 

SMTPAppender: line 112 (from HEAD)
...
    Properties props = new Properties(System.getProperties());

    if (smtpHost != null) {
      props.put("mail.smtp.host", smtpHost);
    }

    Session session = Session.getInstance(props, null);


cheers,

Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org