Java mail, set reply-to address not working

后端 未结 2 522
北荒
北荒 2021-02-13 01:43

I wrote a small email sending program in java, it has from, to and reply-to address, when the client tries to reply to the mail, it should

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-13 02:02

    Message.setReplyTo()?

    Please note that:

    • "from" is not the same as "reply to"
    • according to the spec, the property for from-address is "mail.from"
    • the documentation for getDefaultInstance specifies that this only creates a new instance if there isn't an existing default instance and the properties are only used when creating a new instance. Further, the default instance is a global value and will be re-used, so unless you want the same "from"-address on all your email, you need to create new sessions (using getInstance())

提交回复
热议问题