• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

Email's "To" Field.

 
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Oooooooohhhhhhh. The new page looks cool. But where is the edit button on posts??
 
Rancher
Posts: 1043
6
  • Mark post as helpful
  • send pies
  • 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
  • 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: 1043
6
  • Mark post as helpful
  • send pies
  • 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
  • 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: 1043
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
search for Java preferences api
 
look! it's a bird! it's a plane! It's .... a teeny tiny ad
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic