P
pcmax
Unregistered / Unconfirmed
GUEST, unregistred user!
本人在局域网中配置了一个Exchange邮件服务器,想在一台Tomcat服务器上运行Servlet来发送邮件,Servlet编译没有出错。
其中一段代码如下:
//------------------------------------------------------------------------
out.println("one");
message = new MimeMessage(session);
out.println("two");
message.setFrom(new InternetAddress(from));
out.println("three");
message.addRecipient(Message.RecipientType.TO,new InternetAddress(to));
out.println("four");
message.setSubject(subject);
out.println("five");
message.setText(body);
out.println("six");
Transport.send(message);
out.println("seven");
message.setSentDate(new Date());
out.println("eight");
throwSuccessMessage(out);
//------------------------------------------------------------------------
程序运行时报错如下:
//------------------------------------------------------------------------
one two three four five six javax.mail.NoSuchProviderException: smtp
//------------------------------------------------------------------------
请各位大侠指点。
其中一段代码如下:
//------------------------------------------------------------------------
out.println("one");
message = new MimeMessage(session);
out.println("two");
message.setFrom(new InternetAddress(from));
out.println("three");
message.addRecipient(Message.RecipientType.TO,new InternetAddress(to));
out.println("four");
message.setSubject(subject);
out.println("five");
message.setText(body);
out.println("six");
Transport.send(message);
out.println("seven");
message.setSentDate(new Date());
out.println("eight");
throwSuccessMessage(out);
//------------------------------------------------------------------------
程序运行时报错如下:
//------------------------------------------------------------------------
one two three four five six javax.mail.NoSuchProviderException: smtp
//------------------------------------------------------------------------
请各位大侠指点。