Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sending emails from servlet

 
Nasir Khan
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try passing an empty String to the constructor. The localhost should redirect your email automatically.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic