This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Mail

 
Vivek Vasudevan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am basically tring to send an email via Microsoft outlook using the Javamail API. And right now I am facing a problem which is giving me quite a headache.
In the piece of code below....

// Get system properties
Properties props = System.getProperties();

// Setup mail server
props.put("mail.smtp.host", SMTPhost);

However in the standard code above I have to specifically mention what the SMTP host is. Is there any way by which I neednt specify it implicitly. Is there any piece of code that automatically finds out which SMTP server the MS outlook is connected out.

I really hope some one would help me out.Thanks a million....make that a zillion
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am basically tring to send an email via Microsoft outlook using the Javamail API

No you are not - at least not if you are using JavaMail (If you were using JNI and CDO perhaps, but not with JavaMail). Outlook is not involved in JavaMail at all.

Why? Because Outlook is just a Mail User Agent - in the same way your Java program is. Both will need to know which sever to use. I don't think Outlook keeps its configuration data anywhere easily accessable (like an ini file or something) so I don't think there is an easy way to get this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic