| Author |
Sending Email in java through MS Exchange Server
|
Eduardo Ponce de Leon
Ranch Hand
Joined: May 13, 2009
Posts: 97
|
|
Can somebody walk me to an API on how to send an email using my exchange server properties. I need to send multiple files to multiple recipients with a body message that does not change, so If i can develop a small app for this, it would be really helpful.
Thanks
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
|
JavaMail is that API. The download includes simple examples of sending e-mail as well as receiving e-mail.
|
 |
Eduardo Ponce de Leon
Ranch Hand
Joined: May 13, 2009
Posts: 97
|
|
Paul,
Ive downloaded it but not able to send, this is the example i am using from the file I downloaded...
and this is the error I am getting..
If it is exchanage server, how can I authenticate?
thanks..
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
|
Isn't that in the JavaMail FAQ? Anyway if you don't find the answer in the FAQ, the way to find out about authenticating to that server is to talk to its administrator.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
I don't think authentication is the problem. If you check the stack trace you will see this:
That means that the server you're not allowed to send emails to the domain. You need to change the relaying settings of the mail server.
PS: Eduardo, next time also remove the real email addresses from your stack trace I've done that for you.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
Rob Spoor wrote:I don't think authentication is the problem.
It might be or it might not be. It's possible the server is configured to let authorized users relay. The only way to find out is to ask the server's administrator, as I already suggested. I can see it's a server within the same LAN from its IP address, and it's a fairly large LAN too, so probably you (Eduardo) are in an environment where running a mail server is a serious business. So you should seriously talk to the server administrator; if you make a mess and get your company's server on a spam black-list, it's much better if you had permission from the administrator before doing that.
|
 |
 |
|
|
subject: Sending Email in java through MS Exchange Server
|
|
|