Package org.apache.commons.mail

Examples of org.apache.commons.mail.HtmlEmail.embed()


    email.addTo(mailInfo.getToAddress(), mailInfo.getToName()); // 设定收件人
    email.setFrom(mailInfo.getFromAddress(), mailInfo.getFromName());
    email.setSubject(mailInfo.getSubject());
    // embed the image and get the content id
    File file = new File(mailInfo.getFilePath());
    String cid = email.embed(file);
    // set the html message
    email.setHtmlMsg("<html>" + mailInfo.getHtmlMsg() + "<img src=\"cid:"
        + cid + "\"></html>");

    // set the alternative message

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.