如何在使用javax.mail
發送郵件時設置SMTP消息標識。我的郵件服務器的報告是這樣的:如何使用javax.mail設置或更改SMTP消息ID?
1 <= [email protected] H=mail (host) [192.168.1.4] P=esmtp S=142014
[email protected]
2 => [email protected] R=dnslookup T=remote_smtp H=mx00.t-online.de [194.25.134.8]
3 Completed
我想在發送前設置[email protected]
。這可能嗎?電子郵件像這樣創建:
Properties props = System.getProperties();
props.put("mail.smtp.host", "192.168.1.4");
Session session = Session.getDefaultInstance(props, null);
session.setDebug(false);
Message msg = createMsg();
Transport.send(msg);