(1)method-Using JSPs and Java Mail API
Code from SendMail.jsp
< id="sendMail" class="SendMailBean" scope="page">
<% String a = request.getParameter("p_from"); String b = request.getParameter("p_to"); String c = request.getParameter("p_cc"); String d = request.getParameter("p_subject"); String e = request.getParameter("p_message"); %>
< %= sendMail.send(a, b, c, d, e) %>
(2)method-Using the sendMail utility tag
Code from SendMail.jsp
...
<% //Read all inputs into local variables String from = request.getParameter("p_from"); String to = request.getParameter("p_to"); String cc = request.getParameter("p_cc"); String bcc = request.getParameter("p_bcc"); String subject = request.getParameter("p_subject"); String message = request.getParameter("p_message"); String smtpSvr = request.getParameter("p_smtpServer"); session.setAttribute("smtpServer",l_smtpSvr); %>
< %-- Use OC4J Jsp mail tag to send the mail --%>
< host="'<%="(String)session.getValue(">'
sender='<%=from%>'
recipient='<%=to%>'
cc='<%=cc%>'
bcc='<%=bcc%>'
subject='<%=subject%>'>
<%=message%>
< /mail:sendMail>
...
also try this Click
Monday, February 18, 2008
Sending a mail....
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment