dcsimg
How can I resolve the error 'No Provider for smtp'
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Aihua_Chen
Posted On:   Sunday, April 7, 2002 09:40 PM

How can I resolve the error 'No Provider for smtp'. My OS is WindowsNT workstation. I can send mail correctly by outlook using my company's SMTP host. and I can send mail by postmail.exe and windmail.exe using that SMTP host. but I can't send mail by JavaMail using that SMTP host. I alway be told 'No Provider for smtp' error. The follow is my program. ... Properties props = System.getProperties(); props.put("mail.smtp.host", "XXX.XXX.XXX.XXX"); Session session = Session.getDefaultInstance(props, null); MimeMessage msg = new MimeMessage(session); msg.setFrom(new Inter   More>>

How can I resolve the error 'No Provider for smtp'.


My OS is WindowsNT workstation.

I can send mail correctly by outlook using my company's SMTP host.

and I can send mail by postmail.exe and windmail.exe
using that SMTP host.

but I can't send mail by JavaMail using that SMTP host.
I alway be told 'No Provider for smtp' error.


The follow is my program.

...

Properties props = System.getProperties();

props.put("mail.smtp.host", "XXX.XXX.XXX.XXX");


Session session = Session.getDefaultInstance(props, null);

MimeMessage msg = new MimeMessage(session);

msg.setFrom(new InternetAddress("xxx", "xxx@xxx.xxx"));

msg.setRecipient(Message.RecipientType.TO,
new InternetAddress("xxx@xxx.xxx"));

...

Transport transport = session.getTransport("smtp");

transport.connect(host,25, null, null);

transport.send(msg);

...




Even if I use yahoo POP3 & SMTP host,

I were told "No Provider for pop3" error too.


String smtpHost = "smtp.mail.yahoo.com";

String popHost = "pop.mail.yahoo.com";

   <<Less
About | Sitemap | Contact