This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception in the mail servlet

Venkatachalapathi Madhes
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried out the following mail servlet .
I got the exception NosuchProvider Exception
What I have to do?
I am using VisualAge.
How can solve this probelm
import javax.mail.internet.*;
import javax.mail.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class email extends HttpServlet

String smtphost;
public void doGet(javax.servlet.http.HttpServletRequest request,javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException,
public void mailsend()
java.util.Properties pro = System.getProperties();

//get the Session object to get control over service providers
Session ses = Session.getInstance(pro,null);
//create new message
Message mess = new MimeMessage(ses);

mess.setFrom(new InternetAddress(""));

mess.addRecipient(Message.RecipientType.TO, new InternetAddress(""));


mess.setText("pathi testing mail servlet");

System.out.println("Message over");

//Transport t = ses.getTransport("SMTP_MAIL");

catch(AddressException ade)
System.out.println("Address exception");

catch(SendFailedException sfe)
System.out.println("send failed exception");

catch(NoSuchProviderException nop)
System.out.println("No such provider");
catch(MessagingException me)
System.out.println("messaging exception");


public void init(ServletConfig conf) throws javax.servlet.ServletException



  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic