HI , I'm trying to send an email from servlet using sun.net.smtp.SmtpClient class.. I'm using PostCast server(SMTP server) running on my computer ,The settings are host name: nasir server port : 25 Since SmtpClient api is not available I don't know what to put in the constructor.I tried with following but none is working SmtpClient sc=new SmptClient("nasir:25"); SmtpClient sc=new SmptClient("nasir:2025"); SmtpClient sc=new SmptClient("nasir 2025"); Please help me.... [This message has been edited by Nasir Khan (edited March 14, 2001).]
Angela Lamb
Ranch Hand
Joined: Feb 22, 2001
Posts: 156
posted
0
The constructor for the class is just SmtpClient(String host). It looks like your host name is wrong. Try putting in your IP address instead.
Nasir Khan
Ranch Hand
Joined: Nov 04, 2000
Posts: 135
posted
0
Hi Angela, I tried these SmtpClient sc=new SmptClient("127.0.0.1:2025"); SmtpClient sc=new SmptClient("http://127.0.0.1:2025"); but still can't make it....
Bhupinder Dhillon
Ranch Hand
Joined: Oct 12, 2000
Posts: 124
posted
0
Try passing an empty String to the constructor. The localhost should redirect your email automatically.