How to set smtp?
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   dave_wong
Posted On:   Tuesday, July 24, 2001 02:17 AM

hi there, I am trying a mail-sending program and got a question. I saw the sample from javamail and I copied it and use: Properties props = new Properties(); props.put("mail.smtp.host", mailhost); ... Is it the way to set mail host by this statement? When I use the .class, I got a debug message: DEBUG: SMTPTransport trying to connect to host "localhost", port 25 I've put an IP address to mailhost and not "localhost". What props.put() really do here? And how to set the host?! thanks    More>>

hi there,


I am trying a mail-sending program and got a question.


I saw the sample from javamail and I copied it and use:


			
Properties props = new Properties();
props.put("mail.smtp.host", mailhost);
...

Is it the way to set mail host by this statement? When I use the .class, I got a debug message:


DEBUG: SMTPTransport trying to connect to host "localhost", port 25


I've put an IP address to mailhost and not "localhost".


What props.put() really do here? And how to set the host?!


thanks

   <<Less

Re: How to set smtp?

Posted By:   tibetrain_york  
Posted On:   Wednesday, July 25, 2001 10:46 PM

when i use props.put("mail.smtp.auth","true"); only,i also countered such problem,but later i use both 'put("mail.smtp.host","your domain name");and put("mail.smtp.auth","true");,i suecessed,so just try to use the server domain but not ip address,wish you luck

Re: How to set smtp?

Posted By:   John_Zukowski  
Posted On:   Tuesday, July 24, 2001 06:23 PM

If you are putting the host in the props, you have to make sure the session knows about the props. By your error message, i would say it doesn't.
About | Sitemap | Contact