How can you call your strings in JavaMail method from a JSP?
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jeya_Selliah
Posted On:   Friday, February 8, 2002 07:53 AM

I have the JavaMail progem in Visual Age for Java and my Jsp code in Websphere Studio. I have the following code in my JSP code. When I executed the program, I got this problem "(3 of 5) The variable named subject is not defined" Note: I am using a form to get the inputs from the user and this form calls the following JSP code <% String aFrom,aSubject,aMessage; String[] aTo = new String[40]; try { aFrom = request.getParameter("from"); for (int i=0; i to = aTo[i]; } aSubject = re   More>>



I have the JavaMail progem in
Visual Age for Java and my Jsp code

in Websphere Studio. I have the

following code in my JSP code.
When
I executed the program, I got
this
problem "(3 of 5) The variable

named subject is not
defined"





Note: I am using a form to get the

inputs from the user and this form

calls the following JSP code



			



<%
String aFrom,aSubject,aMessage;
String[] aTo = new String[40];

try {
aFrom = request.getParameter("from");
for (int i=0; i
to = aTo[i];
}
aSubject = request.getParameter("subject");
aMessage = request.getParameter("message");
}
catch (Exception e){
out.println(e.getMessage() + "
" + "Problem!");
}

%>
<%
try{
javamail.sendMail(to,subject,message,from);
out.println("Your mail has been sent successfully!!
");
}
catch (Exception e){
out.println(e.getMessage() + "
" + "Couldn't send your

mail!");
}
%>
   <<Less

Re: How can you call your strings in JavaMail method from a JSP?

Posted By:   Anonymous  
Posted On:   Monday, February 11, 2002 05:42 AM

Further to my earlier mail,actually you have to pass aTo,aSubject,aMessage.aFrom in sendMail method of javaMail.

John Rayan

Re: How can you call your strings in JavaMail method from a JSP?

Posted By:   Anonymous  
Posted On:   Monday, February 11, 2002 05:38 AM

Hi,

Can you tell me why you assign aTo and to variable in the loop? I dont see any declaration for to. Moreover, how do you get values for aTo.


John Rayan
About | Sitemap | Contact