Hi,
 
I tried to compile the email classes in the 'speeltuin', in order to use the multipart functionality, but when I try to send an example mail, I get a java.lang.ClassCastException , in EmailHandler, line 355.
Any idea what might be wrong?
 
Thanks a lot!
 
Bart
 
 
----- Original Message -----
Sent: Friday, October 31, 2003 3:24 PM
Subject: Re: email problem


On Oct 29, 2003, at 12:45 PM, Niels Siemons/SVDT wrote:


Hello,

I've got a problem with a bulkmail sending:
The situation:

I loop throw a list of users for who I create an email node
After a while (about 100 e-mails) I get a Exception: node could not be found.

Via the email tool in mmadmin. I can see that the messagequeue is growing and being send.

Does someone has a suggestion?

Mail settings
Max number of queued messages in memory  500  
Messages queued time  3600  
Queued probe time  300  

Thanks,
Niels


This is a known problem, solved by the email application found in the application dir, the newest version can
be found in the'speeltuin' under my name (daniel). it also has examples. The idea is NOT to loop 500 users but
to greate a group with 500 users attached (lets call this group subscribers) and give that to the mail application. Its
smart enough to see that it has to send mail to each of the users in the attached groep of the email :

----- example ---
<mm:createnode id="mail1" type="email">
<mm:setfield name="from">[EMAIL PROTECTED]</mm:setfield>
<mm:setfield name="subject">test mmbase email</mm:setfield>
<mm:setfield name="body">Tralala</mm:setfield>
</mm:createnode>

<mm:node id="group1" number="groups.testgroep" />

<mm:createrelation source="mail1" destination="group1" role="related" />


<!-- start the mailer but return directly (background mailing) -->
<mm:node referid="mail1">
<mm:field name="startmail(oneshot)" />
</mm:node>
----------------------

It also supports easy way to personalise for each user you mail it will call the jsp's for each user with params for its id :

---- example ------

<mm:createnode id="mail1" type="email">
<mm:setfield name="from">[EMAIL PROTECTED]</mm:setfield>
<mm:setfield name="subject">http://localhost:8123/mmapps/email/example5_subject.jsp</mm:setfield>
<mm:setfield name="body">http://localhost:8123/mmapps/email/example5_body.jsp</mm:setfield>
</mm:createnode>

<mm:node id="group1" number="groups.testgroep" />

<mm:createrelation source="mail1" destination="group1" role="related" />


<!-- start the mailer but return directly (background mailing) -->
<mm:node referid="mail1">
<mm:field name="startmail(oneshot)" />
</mm:node>

----- example body.jsp -------
<[EMAIL PROTECTED] uri="http://www.mmbase.org/mmbase-taglib-1.0" prefix="mm" %>
<mm:cloud>
<mm:import externid="usernumber" />
<mm:node number="$usernumber">
Hi <mm:field name="firstname" /> <mm:field name="lastname" /> !
<p />
Nice to see you again, These are your settings :
<p>
firstname : <mm:field name="firstname" /><br/>
lastname : <mm:field name="lastname" /><br/>
email : <mm:field name="email" /><br/>
account : <mm:field name="account" /><br/>
password : <mm:field name="password" /><br/>
<p>
Bye,<br />
MMBase Email Team.
</mm:node>
</mm:cloud>
--------------------------------------


Last feature is multipart and attachments (only found in the 'speeltuin' cvs)

-------- example ------

<!-- create the email node -->
<mm:createnode id="mail1" type="email">
<mm:setfield name="from">[EMAIL PROTECTED]</mm:setfield>
<mm:setfield name="to"><mm:write referid="to" /></mm:setfield>
<mm:setfield name="subject">my first mmbase mail !!</mm:setfield>
<mm:setfield name="body">
<multipart id="plaintext" type="text/plain">
This is plain text !
</multipart>
<multipart id="htmltext" alt="plaintext" type="text/html">
<H1>THIS IS HTML !</H1>
</multipart>
</mm:setfield>
</mm:createnode>


<!-- send the email node -->
<mm:node referid="mail1">
<mm:field name="mail(oneshot)" />
</mm:node>
---------------------------

Hope this helps,

Daniel Ockeloen
Submarine/MMBased




Reply via email to