java mail authentication via MS Exchange 2003

L

lemonj

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.
 
G

gimme_this_gimme_that

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.
 
G

GaryM

(e-mail address removed) wrote in @o13g2000cwo.googlegroups.com:
Thanks for responses.

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

lemonj

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)
 
G

GaryM

(e-mail address removed) wrote in
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.
 
G

GaryM

(e-mail address removed) wrote in
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.
 
G

GaryM

(e-mail address removed) wrote in
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.
 
G

GaryM

(e-mail address removed) wrote in
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top