Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

java mail authentication via MS Exchange 2003

1 view
Skip to first unread message

lem...@gmail.com

unread,
Jun 21, 2005, 12:13:16 PM6/21/05
to
Hi,

can anyone post a code for sending mail using Exchange 2003 and
javamial (1.3.2). I am getting authentication error but I know the user
and passoword are correct (i can base64 them and log via telnet ). Is
it just constructing correctly the user name or need to configure the
server ?

here is a snip from a working code with qmail server

props.put("mail.smtp.host", "mail");
props.put("mail.smtp.port", "25");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.user", "smtp_cuser");
props.put("mail.smtp.password", "passwd");
props.put("mail.smtp.connectiontimeout", "10000");
Session session = Session.getDefaultInstance(props);

Thanks for responses.

gimme_this...@yahoo.com

unread,
Jun 21, 2005, 1:32:05 PM6/21/05
to
I've had trouble sending emails using Outlook in my sandbox
because our NT sys admin likes to keep IMAP turned off
for security reasons.

I use exim (and renamed it sendmail) to send mails.
Then again, I use cygwin.

GaryM

unread,
Jun 21, 2005, 4:00:17 PM6/21/05
to
lem...@gmail.com wrote in news:1119370396.590571.171530
@o13g2000cwo.googlegroups.com:

> Thanks for responses.

Put it in debug mode and you'll get a better idea of what is going
wrong.

lem...@gmail.com

unread,
Jun 22, 2005, 2:33:56 AM6/22/05
to
I had it in debug mode

---

DEBUG: getProvider() returning
javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun
Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth true
Exception in thread "main" javax.mail.AuthenticationFailedException
at javax.mail.Service.connect(Service.java:264)
at javax.mail.Service.connect(Service.java:134)
at javax.mail.Service.connect(Service.java:86)
at com.sun.mail.smtp.SMTPTransport.connect(SMTPTransport.java:144)
at javax.mail.Transport.send0(Transport.java:150)
at javax.mail.Transport.send(Transport.java:80)

GaryM

unread,
Jun 22, 2005, 8:57:49 AM6/22/05
to
lem...@gmail.com wrote in
news:1119422036.4...@z14g2000cwz.googlegroups.com:

>
> DEBUG: getProvider() returning
> javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,
> Sun Microsystems, Inc]


> DEBUG SMTP: useEhlo true, useAuth true
> Exception in thread "main"
> javax.mail.AuthenticationFailedException
> at javax.mail.Service.connect(Service.java:264)
> at javax.mail.Service.connect(Service.java:134)
> at javax.mail.Service.connect(Service.java:86)
> at
> com.sun.mail.smtp.SMTPTransport.connect(SMTPTransport.java:144

> ) at javax.mail.Transport.send0(Transport.java:150)
> at javax.mail.Transport.send(Transport.java:80)

Strange. I don't see your program in the stack. Can you post the rest
of your code.

GaryM

unread,
Jun 22, 2005, 8:57:49 AM6/22/05
to

>
> DEBUG: getProvider() returning
> javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,

> Sun Microsystems, Inc]


> DEBUG SMTP: useEhlo true, useAuth true
> Exception in thread "main"
> javax.mail.AuthenticationFailedException
> at javax.mail.Service.connect(Service.java:264)
> at javax.mail.Service.connect(Service.java:134)
> at javax.mail.Service.connect(Service.java:86)
> at
> com.sun.mail.smtp.SMTPTransport.connect(SMTPTransport.java:144

> ) at javax.mail.Transport.send0(Transport.java:150)
> at javax.mail.Transport.send(Transport.java:80)

Strange. I don't see your program in the stack. Can you post the rest
of your code.

GaryM

unread,
Jun 22, 2005, 8:57:49 AM6/22/05
to

>
> DEBUG: getProvider() returning
> javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,

> Sun Microsystems, Inc]


> DEBUG SMTP: useEhlo true, useAuth true
> Exception in thread "main"
> javax.mail.AuthenticationFailedException
> at javax.mail.Service.connect(Service.java:264)
> at javax.mail.Service.connect(Service.java:134)
> at javax.mail.Service.connect(Service.java:86)
> at
> com.sun.mail.smtp.SMTPTransport.connect(SMTPTransport.java:144

> ) at javax.mail.Transport.send0(Transport.java:150)
> at javax.mail.Transport.send(Transport.java:80)

Strange. I don't see your program in the stack. Can you post the rest
of your code.

GaryM

unread,
Jun 22, 2005, 8:57:49 AM6/22/05
to

>
> DEBUG: getProvider() returning
> javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,

> Sun Microsystems, Inc]


> DEBUG SMTP: useEhlo true, useAuth true
> Exception in thread "main"
> javax.mail.AuthenticationFailedException
> at javax.mail.Service.connect(Service.java:264)
> at javax.mail.Service.connect(Service.java:134)
> at javax.mail.Service.connect(Service.java:86)
> at
> com.sun.mail.smtp.SMTPTransport.connect(SMTPTransport.java:144

> ) at javax.mail.Transport.send0(Transport.java:150)
> at javax.mail.Transport.send(Transport.java:80)

Strange. I don't see your program in the stack. Can you post the rest
of your code.

0 new messages