[opencms-dev] simpleMail.setMsg() doesn't work
Christoph P. Kukulies
kuku at physik.rwth-aachen.de
Thu Apr 26 10:53:10 CEST 2007
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
More information about the opencms-dev
mailing list