Posted By:
Anonymous
Posted On:
Sunday, December 14, 2003 04:40 PM
When I want to use the method SendMail(), I need to have the mySMTP-string to put in it. But HOW do I get it without having to write it manually before I do the method call. I want the application to check the SMTP server for me. I have tried many different ways, but I always get a "Null" value Here, why do smtp get a nullvalue? String smtp = toString().valueOf(properties.getProperty ("mail.smtp.host")); public void SendMail(String recipients, String subject, String message, String from,String mySMTP) throws MessagingException Properties props = new Properties(); //It's this mySMTP I want to get without typing it manually props.put("ma
More>>
When I want to use the method SendMail(), I need to have the mySMTP-string to put in it. But HOW do I get it without having to write it manually before I do the method call. I want the application to check the SMTP server for me.
I have tried many different ways, but I always get a "Null" value
Here, why do smtp get a nullvalue?
String smtp = toString().valueOf(properties.getProperty
("mail.smtp.host"));
public void SendMail(String recipients, String subject, String message, String from,String mySMTP) throws MessagingException
Properties props = new Properties();
//It's this mySMTP I want to get without typing it manually
props.put("mail.smtp.host", mySMTP);
// create some properties and get the default Session
Session session = Session.getDefaultInstance(props, null);
.
.
I would be so greatful I you could answere this question / Carl
<<Less