gmail 回复不适用于 javamail:无法设置回复
我可以使用 gmail 和 javamail 发送邮件,
但是我无论如何都无法设置回复...
我使用的代码是...
//the actual mail id [email protected]
ccAddress = new InternetAddress( "[email protected]");
msg.setFrom(ccAddress);
Address[] addresses = new Address[1];
//actually i want to addressee to reply-to
addresses[0] = new InternetAddress( "[email protected]" );
msg.setReplyTo(addresses);
msg.setSubject(subject);
msg.setText(text);
msg.setHeader("MIME-Version" , "1.0" );
msg.setHeader("Content-Type" , "text/html" );
msg.setHeader("X-Mailer", "Recommend-It Mailer V2.03c02");
I can send mails with gmail with javamail
But i cannot set the reply to anyhow...
the code i m using is...
//the actual mail id [email protected]
ccAddress = new InternetAddress( "[email protected]");
msg.setFrom(ccAddress);
Address[] addresses = new Address[1];
//actually i want to addressee to reply-to
addresses[0] = new InternetAddress( "[email protected]" );
msg.setReplyTo(addresses);
msg.setSubject(subject);
msg.setText(text);
msg.setHeader("MIME-Version" , "1.0" );
msg.setHeader("Content-Type" , "text/html" );
msg.setHeader("X-Mailer", "Recommend-It Mailer V2.03c02");
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在调用
transport.sendMessage()
之前,请尝试调用msg.saveChanges()
send() 函数在调用 sendMessage() 之前调用此函数,但如果您自己使用 sendMessage(),则必须调用此函数以确保保存所有标头。
Before you call
transport.sendMessage()
, try callingmsg.saveChanges()
The send() function calls this before calling sendMessage(), but if you are using sendMessage() yourself, you will have to call this to make sure any headers are saved.