how to send contact detail in email

how to send contact detail in email

hi...all of u.....i am work in jsp..i m new developer...i have create a my company website... than i have one problem...frnd how to send a contact form detail mail on a click submit button in jsp...pls help me.... this is my html page....

<html>
<head>
<title>Mail API</title>
</head>
<body>
<table border="1" width="50%"  cellpadding="0" cellspacing="0">
  <tr>
  <td width="100%">
  <form method="POST" action="mail.jsp">
  <table border="1" width="100%" cellpadding="0" cellspacing="0">

  <tr>
  <td width="50%"><b>To:</b></td>
  <td width="100%"><input type="text" name="to" size="50"></td>
  </tr>
  <tr>
  <td width="50%"><b>Form:</b></td>
  <td width="100%"><input type="text" name="from" size="50"></td>
  </tr>
  <tr>
  <td width="50%"><b>Subject:</b></td>
  <td width="100%"><input type="text" name="subject" size="50"></td>
  </tr>

<tr>
  <td width="50%"><b>Name:</b></td>
  <td width="100%"><input type="text" name="name" size="50"></td>
  </tr>


<tr>
  <td width="50%"><b>Email:</b></td>
  <td width="100%"><input type="text" name="email" size="50"></td>
  </tr>

<tr>
  <td width="50%"><b>Phone:</b></td>
  <td width="100%"><input type="text" name="phone" size="50"></td>
  </tr>

  <tr>
  <td width="50%"><b>Description:</b></td>
  <td width="100%"><textarea name="description" type="text" 
    cols="40" rows="5" size=80>
  </textarea>
  </td>
  </tr>
  <tr>
  <td><p><input type="submit" value="Send Mail" name="sendMail"></td>
  </tr>
  </table>
  </p>
  </form>
  </td>
  </tr>
</table>
</body>
</html>


and this is my jsp page....

<%@ page language="java" import="javax.naming.*,java.io.*,javax.mail.*,
javax.mail.internet.*,com.sun.mail.smtp.*"%>Ok
<html>
<head>
<title>Mail</title>
</head>
<body>
<%
try{
  Session mailSession = Session.getInstance(System.getProperties());
  Transport transport = new SMTPTransport(mailSession,new URLName("localhost"));
  transport.connect("localhost",25,null,null);
  MimeMessage m = new MimeMessage(mailSession);
  m.setFrom(new InternetAddress(%><%request.getParameter("from")%><%));
  Address[] toAddr = new InternetAddress[] {
  new InternetAddress(%><%request.getParameter("to")%><%)
  };
  m.setRecipients(javax.mail.Message.RecipientType.TO, toAddr );
  m.setSubject(%><%request.getParameter("subject")%><%);
  m.setSentDate(new java.util.Date());

  m.setContent(%><%request.getParameter("description")%><%, "text/plain");
  m.setContent(%><%request.getParameter("name")%><%, "text/plain");
  m.setContent(%><%request.getParameter("email")%><%, "text/plain");
  m.setContent(%><%request.getParameter("phone")%><%, "text/plain");
  transport.sendMessage(m,m.getAllRecipients());
  transport.close();
  out.println("Thanks for sending mail!");
}
catch(Exception e){
  out.println(e.getMessage());
  e.printStackTrace();
}
%>
</body>
</html

> Blockquote
View Answers









Related Tutorials/Questions & Answers:
how to send contact detail in email
how to send contact detail in email  hi...all of u.....i am work... problem...frnd how to send a contact form detail mail on a click submit button...%"><b>Email:</b></td> <td width="100%"><input
how to send email
how to send email  hii i am new for jsp-servlet and i am making a project in jsp-servlet. i want to send the email after registration to client.please send me code that how to send mail after client registration. thank you
Advertisements
how to send html email from dreamweaver
how to send html email from dreamweaver  how to send html email from dreamweaver
how to send email in php and attech with any file
how to send email in php and attech with any file  how to send email and attech with any file like text, image, video
How to send and recieve email by using java mailserver
How to send and recieve email by using java mailserver  How to send and receive email by using java mail server?   Hi Friend, Please visit the following link: Java Mail Thanks
send email with attachments in servlet
send email with attachments in servlet  How can we send an email with attachments in servlet?   Send attached email in Java Servlet
how to send email list of email address through in database table list
how to send email list of email address through in database table list  package com.com; import java.io.IOException; import java.io.PrintWriter; import java.sql.PreparedStatement; import java.sql.ResultSet; import
how to send email please give me details with code in jsp,servlet
how to send email please give me details with code in jsp,servlet  how to send email please give me details with code in jsp,servlet
how to send sms on mobile and email using java code
how to send sms on mobile and email using java code  hi.... I am developing a project where I need to send a confirmation/updation msg on clients mobile and also an email on their particular email id....plz help me to find
How to send Email automatically On Daily Basis Using Systems Date.
How to send Email automatically On Daily Basis Using Systems Date.  Hello Sir, I am working on a project in which i have to send emails automatically based on system dates with attchements .Kindly give me the code
send HTML Email with jsp and servlet
send HTML Email with jsp and servlet  Can You please show me how to send html Email using JSP and Servlet thank you
ModuleNotFoundError: No module named 'send_email'
'send_email' How to remove the ModuleNotFoundError: No module named 'send...ModuleNotFoundError: No module named 'send_email'  Hi, My Python... have to install padas library. You can install send_email python
java code to send an email
java code to send an email  i developed one java code that has to send a mail but i am getting an runtime exception calledjavax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465; nested
ModuleNotFoundError: No module named 'odoo11-addon-runbot-send-email'
: No module named 'odoo11-addon-runbot-send-email' How to remove the ModuleNotFoundError: No module named 'odoo11-addon-runbot-send-email' error...ModuleNotFoundError: No module named 'odoo11-addon-runbot-send-email
ModuleNotFoundError: No module named 'pytest-send-email'
named 'pytest-send-email' How to remove the ModuleNotFoundError: No module named 'pytest-send-email' error? Thanks   Hi, In your...ModuleNotFoundError: No module named 'pytest-send-email'  Hi, My
ModuleNotFoundError: No module named 'send_html_email'
named 'send_html_email' How to remove the ModuleNotFoundError: No module named 'send_html_email' error? Thanks   Hi, In your python...ModuleNotFoundError: No module named 'send_html_email'  Hi, My
ModuleNotFoundError: No module named 'send_email_message'
named 'send_email_message' How to remove the ModuleNotFoundError: No module named 'send_email_message' error? Thanks   Hi, In your...ModuleNotFoundError: No module named 'send_email_message'  Hi, My
ModuleNotFoundError: No module named 'send_html_email'
named 'send_html_email' How to remove the ModuleNotFoundError: No module named 'send_html_email' error? Thanks   Hi, In your python...ModuleNotFoundError: No module named 'send_html_email'  Hi, My
ModuleNotFoundError: No module named 'django-send-email'
named 'django-send-email' How to remove the ModuleNotFoundError: No module named 'django-send-email' error? Thanks   Hi, In your...ModuleNotFoundError: No module named 'django-send-email'  Hi, My
Send email as html with embedded images as background
Send email as html with embedded images as background  Hi, I am developing a PHP mailing application. I have to send image in the email as attachment. Give me solution for sending image in the email data. Thanks
java code to send email using gmail smtp server
java code to send email using gmail smtp server  please send me the java code to send email using gmail smtp server. and how to send verification code
To send pdf file to email in java
To send pdf file to email in java   Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/sun/mail/util/MailLogger at javax.mail.Session.initLogger(Session.java:283) at javax.mail.Session.
Send Email From JSP & Servlet
J2EE Tutorial - Send Email From JSP & Servlet      ... how the required data such as 'from', 'to', 'subject' and 'message
how to send message
how to send message  how to send message for mobile in server
how to send sms on mobile
how to send sms on mobile  send sms on mobile by using struts + spring
How i can send mail by using jsp.............. - JavaMail
How i can send mail by using JSP  Hi, will you please tell me how i can send mail by using jsp. Tell me in detail. Thanks!  Example and JSP... to create a send mail program using JSP.JSP Send Mail Program Resources:-http
This code send email two times but i want only once
This code send email two times but i want only once   public void dbbackup_notify(String email,String data,String subject){ String toEmails = email; Session session=Session.getInstance(props, new
This code send email two times but i want only once
This code send email two times but i want only once   public void dbbackup_notify(String email,String data,String subject){ String toEmails = email; Session session=Session.getInstance(props, new
How to send HTTP request in java?
How to send HTTP request in java?  How to send HTTP request in java
how to display the email message in jsp
how to display the email message in jsp  hi every one .. i am new from this industry please help me to display the email message in jsp page please send me sample code
email
email  how do i code for making clicking a send button sends a email
How does Email works
How does Email works      ... server contact to the Recipient’s Email server provided in the Email... send email to the address’s email server. When recipient log on his mail
How to send mail - JSP-Servlet
How to send mail  Thanks a lot ODBC is cleared to me now. Now,have another query about how we can send mail by using jsp. Actually i want to make a web page for a user feedback ,it must be send to our mail id
How to send massage like way2sms.com
How to send massage like sms websites  Hi sir how i can make a small project in php (send massage by website like free sms website on internet) Please advice me
how to validate the email login
how to validate the email login  // JavaScript Document JOIN US... Name Email Contact No Address City new.jsp <%@page import="java.sql....; var lname=document.form.lname.value; var email=document.form.email.value; var
How to send the request and get the request?
How to send the request and get the request?  how to send a request to a JSP file in another domain in the same server and get the request done i.e how to include JSP file of one domain to another doamin JSP within in the same
email
email   hi I am using 1and1 server. Using this server i am sending a mail using java program . But it is running some problem occur " Cannot send email. javax.mail.SendFailedException: Invalid Addresses;ADS_TO_REPLACE_1
how send nsnotification to forward class
how send nsnotification to forward class   how to send nsnotification to a forward class? i am sending a nsnotification to a class which is not loaded yet. example,there is a class A,where i am creating a dictionary and posting
How to send UIWebView Title to UINavigationBar
How to send UIWebView Title to UINavigationBar  How can i replace the title of the UINavigationBar to UIWebView Page Title(i.e. javascript title)?   Write the given code into webViewDidFinishLoad method NSString
how to send a mail - JSP-Servlet
how to send a mail  Dear sir, I am able to send a mail.But when a receiver gets a mail ,the matter will be shown in a single line . I am... how to get a matter as it is what am sending..please help me sir if any changes
plese send information how to do this - Development process
plese send information how to do this  present i am doing project... .send confirmation about car modification .cancellation conformation.... And if i click on ok it will send to the customer and display sent successfully
how to send mail with multiple attachments in jsp
how to send mail with multiple attachments in jsp  how to send mail with multiple attachments in java script
How to send message in struts on mobile - Struts
How to send message in struts on mobile  Hello Experts, How can i send messages on mobile i am working on strus application and i want to send message from jsp
how to send emails to many using jsp by connecting to ms access dabase.
how to send emails to many using jsp by connecting to ms access dabase.  Hi. I am trying to send multiple emails and the email ids are stored in a table in a msaccess database.I am using jsp for this.And finally there should
How to send data by ajax to servlet? - Ajax
How to send data by ajax to servlet?  Hi, Can i send a value from a HTML file to servlet via Ajax? If it is possible please give me a sample code Thanks
Send E-mail in HTML
Send E-mail in HTML       The Tutorial describes you a code that help you to send Email... to send email from HTML page. In this page user can enter Name, Email -id
How to send NSURLConnection synchronous request on https?
How to send NSURLConnection synchronous request on https?  Hi, Give me program example of NSURLConnection synchronous request on https. Thanks
How to send sms alerts to mobile using java?
How to send sms alerts to mobile using java?  Hi i have used the Code to send message on mobile using java code, it is not working - COM2...(CommPortIdentifier.java:105) confusion is there what is COM2 port and how
How do i validate form using javascript and send data to database?
How do i validate form using javascript and send data to database?  I... into the database are: FIRST NAME, LAST NAME, EMAIL ADDRESS, PHONE NUMBER, ADDRESS... fname=document.form.fname.value; var lname=document.form.lname.value; var email
how to send spaces using get method.
how to send spaces using get method.  hi i want to know how to send spaces using get method? for example like http://localhost:8080/Sandeep?name=rose india sorry for my english   Hello Friend, Try the following

Ads