• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sending Email in java through MS Exchange Server

 
Eduardo Ponce de Leon
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20719
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20719
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20493
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Paul Clapham
Sheriff
Pie
Posts: 20719
30
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic