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
Vivek Vasudevan<br />"Today is the first day of the rest of your life"
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.