[opencms-dev] Email question using opencms

twinkle fourrz at yahoo.com
Tue Apr 4 19:17:47 CEST 2006


I took the following code from a thread posted in Aug 2005. This is not working in offline/online in v 6.0. I am able to read the form values but the email script is buggy. The script does not go into the TRY statement. Any help? Thanks
   
  -Twinkle
   
  <%@ page import="org.opencms.mail.CmsSimpleMail" %>
<%@ page import="org.opencms.jsp.CmsJspBean" %>
<%@ page import="org.opencms.jsp.*" %>
<%@ page import="org.opencms.file.*" %>
<%@ page import="org.opencms.flex.*" %>
<%@ page import="javax.mail.*" %>

<%
org.opencms.mail.CmsSimpleMail sm = new
org.opencms.mail.CmsSimpleMail();
org.opencms.jsp.CmsJspActionElement cmsjsp = new
org.opencms.jsp.CmsJspActionElement(pageContext, request,
response);
        org.opencms.file.CmsObject cmsObject =
cmsjsp.getCmsObject();
try{
String to = "aleksandra at eteg.com.br";
String email = request.getParameter("email");
String nome = request.getParameter("nome");
String assunto = request.getParameter("assunto");
String mensagem = request.getParameter("mensagem");
sm.setMsg("email :" + email +"\n" + "nome :"+nome+"\n" +
"mensagem :"+mensagem);
sm.addTo(to);
sm.setFrom("*********");
sm.setSubject(assunto); 
        if (request.getParameter("email")!=null &
request.getParameter("mensagem")!=null){
sm.send();
out.println("<td class=\"content_title\"
valign=\"top\">Sua mensagem foi enviada!</td>");
}
else out.println(new java.util.Date());
}
catch (MessagingException e) {
out.println("<td class=\"content_title\"
valign=\"top\">Email nao pode ser enviado!</td>");
}

%>
and this offline it works well but online he is not reading
the parameters email,....all from the forms but he is
reaching my jsp because he is executing out.println(new
java.util.Date());.
So request.getParameter("email") and the other ones are not
working !



			
---------------------------------
Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060404/dab744a8/attachment.htm>


More information about the opencms-dev mailing list