0

我正在使用 Quartz 调度程序中的 SendMailJob 类寻求帮助。我一直找不到任何有用的文档,也无法找出实现它以从 Web 应用程序按需发送批量邮件的“正确”方法(这样该过程不依赖于 servlet 继续存在于电子邮件作业的整个生命周期中)

4

1 回答 1

-1

这个类提供了发送邮件的非常基本的选项。您应该更好地重写您自己的类,该类将与您的应用程序更加集成。似乎与SendMailJob生产类一样作为示例存在......

无论如何,如果您想使用它,您必须在 JobData 映射中填充以下参数才能发送邮件。如果您需要更多详细信息,请查看该类的源代码。

/**
 * The host name of the smtp server. REQUIRED.
 */
public static final String PROP_SMTP_HOST = "smtp_host";

/**
 * The e-mail address to send the mail to. REQUIRED.
 */
public static final String PROP_RECIPIENT = "recipient";

/**
 * The e-mail address to cc the mail to. Optional.
 */
public static final String PROP_CC_RECIPIENT = "cc_recipient";

/**
 * The e-mail address to claim the mail is from. REQUIRED.
 */
public static final String PROP_SENDER = "sender";

/**
 * The e-mail address the message should say to reply to. Optional.
 */
public static final String PROP_REPLY_TO = "reply_to";

/**
 * The subject to place on the e-mail. REQUIRED.
 */
public static final String PROP_SUBJECT = "subject";

/**
 * The e-mail message body. REQUIRED.
 */
public static final String PROP_MESSAGE = "message";

/**
 * The message content type. For example, "text/html". Optional.
 */
public static final String PROP_CONTENT_TYPE = "content_type";
于 2012-09-24T13:43:57.977 回答