Java mailto to MIME

后端 未结 1 624
醉话见心
醉话见心 2021-01-27 02:06

Looking for a Java library to convert a mailto link to a MIME message, or at least fill in the parts of it that are contained within the mailto link. Only solution I\'ve found

1条回答
  •  失恋的感觉
    2021-01-27 02:39

    As far as I can tell something simple does not exist. The following code worked using the Uri class from Android, which was not complicated to excise from the Android libraries:

    MailTo mailTo = MailTo.parse(unsubscribeUrl);
    
            Map headers = mailTo.getHeaders();
            Set> values = headers.entrySet();
    
            for (Map.Entry header : values) {
                message.addHeader(header.getKey(), header.getValue());
            }
    

    0 讨论(0)
提交回复
热议问题