Home Answers Viewqa JavaMail how to send contact detail in email

 
 


surendra
how to send contact detail in email
0 Answer(s)      a year ago
Posted in : JavaMail

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 Pages:
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
email
email  how do i code for making clicking a send button sends a email
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; nested exception
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
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
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
Sending mail (Contact Form in a website)
Sending mail (Contact Form in a website)  Hi, I just uploaded few... pages. Am very much new into this field. I want to write a contact form, which on submit should send the details to my inbox. I heard this can be possible in PHP
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 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
Contact Us
Rose India D-16/116 Sector-3, Rohini Delhi-110085 India Phone: +91-9313063554 Email: deepak@roseindia.net
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
JSP Email
JSP Email  Hi, How to send email using JSP? Thanks   Hi, Check this tutorial: Send Email to selected dropdown user 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
Java Email
Java Email  I am making one java email applications using jsp-servlets. can you tell me that how can i recieve and send email dynamically in my application in UI... thanx.   Hi, Please read at Email From JSP &
Send Email From JSP & Servlet
J2EE Tutorial - Send Email From JSP & Servlet       A simple html form... webserver, using JavaMail API, the following code shows how the required
contact and activity management system
contact and activity management system  how to make a web application on contact and activity management system. can anyone help me
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
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
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
email extractor - Java Beginners
email extractor  how to extract only email address from a lines... If any more queries, feel free to contact to my above email address. Regards... queries. /** * Program to scan email address from a file and write into an other
email extractor - Java Beginners
email extractor  how to extract only email address from a lines of text file(.txt or .doc) and print in another file? will u send me answer in c language? I have the idea ,copying one file text to another file by using buffer
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
PHP Email Tutorial, Sending email from PHP
Sending mail in PHP In this section we will learn how to send email from PHP program. You can send email from your PHP script using mail(...) function... additional_headers). will send e-mail message with the message body containing
sending automatic email - JavaMail
sending automatic email  Dear sir. In my project i need to send an automatic email to the clients when their accounts are going to expire in 30... in the mysql database. i dont know how to achieve this one,please help me sir
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
Sending an email in JSP
Sending an email in JSP       Sending an email in JSP In this section, you will learn how to send an email in jsp.   Following is a simple JSP page for sending
Email - Electronic mail
Email - Electronic mail In this article we will understand the E-mail and see how it works? Now a days email is integral part of day to day life for all... compose, send and receive emails from anywhere in the world. Most email
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
sending email code - JSP-Servlet
sending email code  How To Send Emails using jsp  Hi friend, I am sending you a link. This link will help you. Please visit for more information. http://www.roseindia.net/mail/sending-an-email
send mail using JavaScript
send mail using JavaScript  How can we send mail using JavaScript?   Hi friends, You can not send email directly using JavaScript. But you can use JavaScript to execute a client side email program send the email using
Sending email with read and delivery requests
Sending email with read and delivery requests  Hi there, I am..., and I'm having difficulty understanding how to implement, read and delivery..., Gareth   Please visit the following link: JSP Servlet Send Mail
Email sending
Email sending  Hi sir, Am doing a project, in that i need to send email to multiple recipients at a same time using jsp so send me the code as soon as possible. Regards, Santhosh
Connectivity with sql in detail - JDBC
Connectivity with sql in detail  Sir/Madam, I am unable to connect the sql with Java. Please tell me in detail that how to connect. Thankyou
Connectivity with sql in detail - JDBC
Connectivity with sql in detail  Sir/Madam, I am unable to connect the sql with Java. Please tell me in detail that how to connect. Thankyou
Change Email
Change Email  Hi, I need to change my Rose India register email address for receive email, How did it possible
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
Connectivity with sql in detail - JDBC
Connectivity with sql in detail  Sir/Madam, I am unable to connect the sql with Java. Please tell me in detail that how to connect. Thankyou.  Hi Friend, Put mysql-connector
project detail - Java Beginners
project detail  How to do project in java I am doing final MCA i want to do project I am willing to do project in java or j2ee. But I have no idea so I want some idea about project in java please give some sample project
java auto mail send - Struts
java struts , eclipse & tomcat. i want to send mail automatically when the server start..I use the code for send mail..but i dont know how to sent... javax.mail.internet.*; import java.util.*; public class Main { String d_email
how to send message
how to send message  how to send message for mobile in server
Java Email
Java Email  i am writting a program to send emails using gmail smtp server. I had the following error: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/mail
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
Sending Email with Attachment
Sending Email with Attachment       This Example shows you how to send a Attachment in the message using... the Transport.send() method. By this code you can get functionality to send Email
Contact Us, Contact Rose India
Contact Us Rose India is an eminent Software firm that also provides a wide range of services includes high technology, end to end... Email: deepak@roseindia.net
how to send sms on mobile
how to send sms on mobile  send sms on mobile by using struts + spring

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.