• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to send email through jsp using localhost.

 
Prashant Chindhade
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi everyone can you please help me to write a application that can send email through jsp and servlet.
using localhost as a SMTP server. I have written following code for it.

mail.jsp


mailer.jsp


MailerBean.java

i got a following error




can anyone please help me..?
 
sri ramvaithiyanathan
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey use this link to Send Mail
Let me tell you one thing,
get subject,to,from address from user using jsp and onsubmit call the action file.
After the mail sent,redirect to success page or failure page.

you are unnecessarily using so many jsp page.Its not good way of coding.
In the above link you can get clear information for sending mail using java program.

pass the required field to java program and change it accordingly to fit for your design.

P.S: Dont raise the reply count unnecessarily.Its not fair.
Nothing is there to deal about Tomcat.kindly choose right category.

Regards,
Sriram.V
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put the MailberBean class in a package, and import it properly in your JSP page.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!