Apache Commons Email 怎样设置邮件优先级?

Apache Commons Email 怎样设置邮件优先级?

 

类 org.apache.commons.mail.Email 及其子类

包括    MultiPartEmail, SimpleEmail, HtmlEmail, ImageHtmlEmail

 

 

// Email email = Email的实例;
email.addHeader("X-Priority", "1");

也可以把文字带上

// Email email = Email的实例;
email.addHeader("X-Priority", "1 (Highest)");

 

 

优先级数值:

 

1( highest ) or  2( high ) 3( normal ) 4( low ) and 5( lowest )

 

 

默认为 "3" 

 

Values: 1 (Highest), 2 (High), 3 (Normal), 4 (Low), 5 (Lowest).
3 (Normal) is default if the field is omitted.
 

 

下面是该方法的文档说明:

 

public void addHeader(String name,
                      String value)


Adds a header ( name, value ) to the headers Map.

 Example:

 X-Mailer: Sendmail, 
 X-Priority: 1( highest ) or  2( high ) 3( normal ) 4( low ) and 5( lowest )
 Disposition-Notification-To: user@domain.net

 

 

 网上关于邮件优先级的资料:

 

Email Importance / Priority

http://www.chilkatsoft.com/p/p_471.asp

You can add the X-Priority header field and give it the value string "1″. For example: email.AddHeaderField "X-Priority","1″ This is the most common way of setting the priority of an email. "3″ is normal, and "5″ is the lowest. "2″ and "4″ are in-betweens, and frankly I’ve never seen anything but "1″ or "3″ used. Microsoft Outlook adds these header fields when setting a message to High priority:

X-Priority: 1 (Highest)
X-MSMail-Priority: High
Importance: High

I don’t think you’ll need all three, but you can add them all if you wish. My recommendation is to only add the X-Priority header.

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值