• 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

Email's "To" Field.

 
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,

I have a question regarding sending mail and the "To" section of the outlook. I wrote a code of sending mail. And that same code is being used by 3 of 4 of my colleagues. So now when they run the code, the mail seems to come from me. The To section is being populated by my email address and everyone thinks that i had ran the code. Now the values are hard coded. But wanted to know is there any way of making it more flexible? Like the person sending the mail should have the email id populated in the To section of the mail. Don't want to do it via hard coding. Any suggestions on this would be appreciated. Thanks!
 
Somnath Mallick
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oooooooohhhhhhh. The new page looks cool. But where is the edit button on posts??
 
Rancher
Posts: 1044
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is called configuration.

You don't hardwire the data into your program but obtain it from some external source.
For example the program could read in some configuration file with these data.
A popular format for this purpose is Java Properties file as either a flat or an xml one.

Almost any non-trivial program needs some configuration.

Of course the program could obtain the necessary value as a System property or (if applicable) a command-line argument.
 
Somnath Mallick
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I thought of properties file. But thought that lets say tomorrow a new person runs the code and he then has to add his email id. I want to make the code intelligent enough to know what exchange server email id is configured in outlook for the guy. Anyway to do it.
 
Ivan Jozsef Balazs
Rancher
Posts: 1044
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might also want to have a look at the Preferences API.
 
Somnath Mallick
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a complete new API for me. Any pointers on how to use this?
 
Ivan Jozsef Balazs
Rancher
Posts: 1044
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
search for Java preferences api
 
I have gone to look for myself. If I should return before I get back, keep me here with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic