init: 导入项目
This commit is contained in:
20
Webplatform/src/main/java/com/wb/controls/Mailer.java
Normal file
20
Webplatform/src/main/java/com/wb/controls/Mailer.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package com.wb.controls;
|
||||
|
||||
/**
|
||||
* 发送邮件控件。
|
||||
*/
|
||||
public class Mailer extends Control {
|
||||
public void create() throws Exception {
|
||||
if (gb("disabled", false))
|
||||
return;
|
||||
com.wb.tool.MailSender mailSender = new com.wb.tool.MailSender(gs("smtp"), gs("username"),
|
||||
gs("password"), gb("needAuth", true));
|
||||
try {
|
||||
mailSender.send(gs("from"), gs("to"), gs("cc"), gs("bcc"),
|
||||
gs("title"), gs("content"), gs("attachFiles"), request,
|
||||
gs("attachObjects"), gs("attachObjectNames"));
|
||||
} finally {
|
||||
mailSender.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user