• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java Mail

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic