[opencms-dev] simpleMail.setMsg() doesn't work

Christoph P. Kukulies kuku at physik.rwth-aachen.de
Thu Apr 26 11:31:55 CEST 2007


Oh oh, stupid me. I thought that setMsg is somehow cumulative
but it can't. And the last parameter, that built the message was empty 
and so was the message body.

No further action required. Thanks for reading :)


--
Chris Christoph P. U. Kukulies kukulies (at) rwth-aachen.de

On Thu, Apr 26, 2007 at 10:53:10AM +0200, Christoph P. Kukulies wrote:
> The following snippet sends a registration Mail (not yet complete
> but to get the idea):
> 
> <%@ page session="false" %import="java.util.*,org.opencms.jsp.*,org.opencms.mail.CmsSimpleMail" %>
> <%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
> <%    CmsJspActionElement jsp = new CmsJspActionElement(pageContext,
> request,response);
> 
>      String username =
> jsp.getCmsObject().getRequestContext().currentUser().getName();
> 
>      CmsSimpleMail simplemail= new CmsSimpleMail();
>      simplemail.addTo("webmaster at myorg.de","Webmeister");
>      simplemail.setFrom("opencms at myorg.de");
>      simplemail.setSubject("Jemand moechte sich als Mitglied registrieren");
>      simplemail.setMsg(request.getParameter("firma") + ":" + request.getParameter("mitgliedsnr"));
>     
>      simplemail.setMsg(request.getParameter("adresse1") + ":" + request.getParameter("land"));
>      simplemail.setMsg(request.getParameter("plz") + ":" + request.getParameter("ort"));
>      simplemail.setMsg(request.getParameter("telefon") + ":" + request.getParameter("email"));
>      simplemail.setMsg(request.getParameter("vorname") + ":" + request.getParameter("nachname"));
>      simplemail.setMsg(request.getParameter("anmerkungen") );
>      
>      try {
>         simplemail.send();
>         response.sendRedirect("/de/sonstiges/mailgesendet.htm");
>      } catch (Exception e) {
>           response.sendRedirect("/de/sonstiges/sendefehler.htm");
>      }
> %>
> 
> The subject arrives but the message body is empty.
> 
> Any ideas?
> 
> --
> Chris Christoph P. U. Kukulies kukulies (at) rwth-aachen.de
> 
> 
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev




More information about the opencms-dev mailing list