简体   繁体   English

使用Velocity Engine的Spring邮件

[英]Spring mail with Velocity Engine

I am trying to write a class that sends email by using spring mail and velocity template engine. 我正在尝试编写一个使用Spring邮件和Velocity模板引擎发送电子邮件的类。 I want to use email templates because there is lots of email types in my system. 我想使用电子邮件模板,因为我的系统中有很多电子邮件类型。 I looked at this post, but there is something wrong with MimeMessagePreparator . 我看了这篇文章,但是MimeMessagePreparator出了点问题。 It overrides prepare method and prepare method use javax.mail as parameter. 它覆盖了prepare方法,并且prepare方法使用javax.mail作为参数。 I have add maven dependency of java mail api. 我已经添加了java邮件api的maven依赖项。 This time, it overrided current spring mail api. 这次,它覆盖了当前的spring mail api。 If you have ever used spring mail and velocity template together, could you please help on this? 如果您曾经一起使用过Spring Mail和Velocity模板,那么请您提供帮助吗?

Thanks in advance 提前致谢

javax.mail mail 1.4 javax.mail邮件1.4

after import, it overrides spring mail api. 导入后,它将覆盖spring mail api。 I have re-added spring mail classes to project and it worked. 我已经将spring邮件类重新添加到项目中,并且可以正常工作。 Spring mail classes are the ones org.springframework.mail.javamail.* Spring邮件类是org.springframework.mail.javamail.*

Thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM