This software is OSI Certified Open Source Software. OSI Certified is a certification mark of the Open Source Initiative.
The license (Mozilla version 1.0) can be read at the MMBase site. See http://www.mmbase.org/license
Table of Contents
The MMBase 1.6 release contains an email module which makes it possible to send email with MMBase. The module consist of the following components
the module configuration file: /conf/modules/sendmail.xml
the builder: config/applications/MyUsers/builders/email.xml
In sendmail.xml you can set the status of the email module to be active or inactive. Furthermore you can select the module which MMBase will use to send email.
SendMail
Example 1. Example configuration to let MMBase use SendMail
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//MMBase/ DTD module config 1.0//EN" "http://www.mmbase.org/dtd/module_1_0.dtd">
<status>active</status>
<classfile>org.mmbase.module.SendMail</classfile>
<properties>
<property name="mailhost">smtp.xs4all.nl</property>
</properties>
</module>JMSendMail
Example 2. Example configuration to let MMBase use JMSendMail
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//MMBase/ DTD module config 1.0//EN" "http://www.mmbase.org/dtd/module_1_0.dtd">
<module maintainer="mmbase.org" version="0">
<status>active</status>
<classfile>org.mmbase.module.JMSendMail</classfile>
<properties>
<property name="context">java:comp/env</property>
<property name="datasource">mail/MMBase</property>
</properties>
</module>TO DO: in the case of JMSendMail where is the mailhost specified?
The email builder has the following fields.
subject
from
to
replyto
bodyurl (TO DO: how and when does this work ?)
body
Is the body of your email message.
If you add <HTML> ... </HTML> to the body field, the email message will be send as html mail. The <HTML> tags have to be in uppercase.
mailtype
Type of the email: 1:one shot email, 2: repeat email, 3: oneshot email, but keep result
mailstatus
mailtime
Time to send this mail
buildtime
Time this email was created
repeattime
Time period after which sending of the email is repeated (TO DO: what is the unit of time used here?)
mailedtime
Last time on this email was send
Of course you can use the mmeditors or another MMBase editor to create nodes of type email, and thereby send email from MMBase. Much more meaningfull however is to use the email module to send email from your JSP pages. The next programlisting shows how you can do this:
<mm:createnode type="email"> <mm:setfield name="subject"><%= articleTitle %></mm:setfield> <mm:setfield name="from">me@mmbase.org</mm:setfield> <mm:setfield name="to">you@mmbase.org</mm:setfield> <mm:setfield name="replyto">you@mmbase.org</mm:setfield> <mm:setfield name="body"><%= "<HTML>" + articleText + "</HTML>" %></mm:setfield> </mm:createnode>
In the programlisting articleTitle is a jsp variable containing the subject of the email message and articleText is a jsp variable containg the html text for the email body.
This is part of the MMBase documentation.
For questions and remarks about this documentation mail to: documentation@mmbase.org