Sending emails


The release of jLo includes a mail handler that can send emails. In order to use the mail handler you have to define a few parameters inside the generator block. Here is the XML for this:

<generator name="MailGenerator">
  <formatter class="DefaultFormatter"/>
  <handler class="MailHandler">
    <parameter name="smtphost" value="smtp.mail.yahoo.com"/>
    <parameter name="sender" value="andreasmecky@yahoo.de"/>
    <parameter name="recipient" value="andreas.mecky@xcom.de"/>
    <parameter name="subject" value="Error Mail"/>
  </handler>    
</generator> 

The subject will be the subject of the mail. If you want more than one recipient then put in all separated with a comma like this:

<parameter name="recipient" value="andreas.mecky@xcom.de,terry.dye@xcom.de"/>

Most mailserver requires the so called "smtp-after-pop". This means that you have to do a pop reuqest before you are allowed to send an email. Therefore you have to use the following parameters. This will force the MailHandler to do a pop request before it will actually send an email:

<generator name="MailGenerator">
  <formatter class="DefaultFormatter"/>
  <handler class="MailHandler">    
    <parameter name="smtphost" value="smtp.mail.yahoo.com"/>
    <parameter name="sender" value="andreasmecky@yahoo.de"/>
    <parameter name="recipient" value="andreas.mecky@xcom.de"/>
    <parameter name="subject" value="Error Mail"/>
    <parameter name="user" value="user"/>
    <parameter name="pwd" value="pwd"/>
    <parameter name="popserver" value="pop.mail.yahoo.com"/>
    <parameter name="authentification" value="true"/>
  </handler>
</generator>