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();
		}
	}
}
