How to add more parameters to JavaMail method?.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jeya_Selliah
Posted On:   Monday, March 25, 2002 06:02 PM

Right now in my form I have four parameters such as subject, to, from, and message. In my jsp form I wanted to add phone parameter. Can we modify sendMail method or need to do something else or create a get and set method for phone and use it in the method of sendMail method. For eg. my approach would be:. Class file: public void setPhone(String p){ phone=p; } public String getPhone() { return phone; } in sendMail { ....... message.setPhone(phone); ....... } In Jsp file: <% String aPhone = request.getParameter(phone); ....... x.sendMail(from, to , subject, message); %> Correct   More>>


Right now in my form I have four parameters such as subject, to, from, and message. In my jsp form I wanted to add phone parameter. Can we modify sendMail method or need to do something else or create a get and set method for phone and use it in the method of sendMail method. For eg. my approach would be:.


			Class file:
			
public void setPhone(String p){
phone=p;
}
public String getPhone() {
return phone;
}
in sendMail {
.......
message.setPhone(phone);
.......
}

In Jsp file:
<%
String aPhone = request.getParameter(phone);
.......
x.sendMail(from, to , subject, message);
%>


Correct me if I am worng. Thank you very much.

   <<Less

Re: How to add more parameters to JavaMail method?.

Posted By:   Jeff_Gay  
Posted On:   Friday, March 29, 2002 06:08 PM

There are several directions that you can take.

The first is putting the phone number into the contents of the message. Simple text.


The second is adding a header to the message. You'll have to use MimeMessage.addHeader(). Keep in mind that this header will not be standard in anyway.


The third is creating an file, a VCard is a good choice, and attaching it to the message.

About | Sitemap | Contact