james-server-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Norman <nor...@apache.org>
Subject Re: send email twice to the same email address
Date Thu, 09 Sep 2010 05:51:27 GMT
Hi there,

sorry I missread your problem.. The solution to your problem is calling 
MimeMessage.saveChanges();

So this should work:

this.getMailetContext().sendMail(mail.getSender(), emailAddress, 
mail.getMessage(), MY_FORWARD_PROCESSOR);

mail.getMessage().setSubject("Changed subject");
mail.getMessage().saveChanges();

this.getMailetContext().sendMail(mail.getSender(), 
this.jobApplyAdminAddress, mail.getMessage(), 
JobApplyProcessingConfigContext.FORWARD_PROCESSOR);


See:
http://java.sun.com/products/javamail/javadocs/javax/mail/internet/MimeMessage.html#saveChanges()

Bye,
Norman


Am 09.09.2010 07:32, schrieb Norman:
> Hi thiere,
>
> you need to duplicate the mail when send it a second time. Use 
> something like this to get a duplicate:
>
> MailImpl.duplicate(mail, "uniquename");
>
>
> The uniquename must be generated by you, you can prolly just use some 
> String + Random.nextLong();
>
> Bye,
> Norman
>
> Am 08.09.2010 23:52, schrieb haipeng du:
>> I try to use mail context to send email:
>> this.getMailetContext().sendMail(mail.getSender(), emailAddress,
>>                                                   mail.getMessage(),
>> MY_FORWARD_PROCESSOR);
>> mail.getMessage().setSubject("Changed subject");
>> this.getMailetContext().sendMail(mail.getSender(),
>> this.jobApplyAdminAddress,
>>                                                   mail.getMessage(),
>> JobApplyProcessingConfigContext.FORWARD_PROCESSOR);
>>
>>   it will only send mail one time.
>> What kind of stuff I missed?
>> Thanks.
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Mime
View raw message