aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes Sending Email in java through MS Exchange Server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Sending Email in java through MS Exchange Server" Watch "Sending Email in java through MS Exchange Server" New topic
Author

Sending Email in java through MS Exchange Server

Eduardo Ponce de Leon
Ranch Hand

Joined: May 13, 2009
Posts: 99
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: 18167
    
    8

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: 99
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: 18167
    
    8

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: 19557
    
  16

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 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18167
    
    8

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sending Email in java through MS Exchange Server
 
Similar Threads
install a ms exchange server
web mail using Javamail API
SMTP server
Java mail and Microsoft Exchange Server
Big Moose Saloon logo