Package com.alibaba.citrus.service.mail.builder.content

Examples of com.alibaba.citrus.service.mail.builder.content.AlternativeMultipartContent


        // ��������contents��
        MultipartContent attachable = new MixedMultipartContent();
        attachable.setId("attachable");

        MultipartContent alternative = new AlternativeMultipartContent();
        alternative.setId("alternative");

        TextContent plainText = new TextContent("�Ұ��������д�", "text/plain");
        plainText.setId("plainText");

        TextContent htmlText = new TextContent("<���������д�>", "text/html");
        htmlText.setId("htmlText");

        TextTemplateContent plainTextTemplate = new TextTemplateContent("mail/mytemplate.vm", "text/plain");
        plainTextTemplate.setId("plainTextTemplate");

        AttachmentContent textAttachment = new AttachmentContent("testfile.txt");
        textAttachment.setId("textAttachment");

        HTMLTemplateContent htmlTemplate = new HTMLTemplateContent("mail/complexhtml.vm");
        htmlTemplate.setId("htmlTemplate");

        plainTextTemplate.setTemplateService(templateService);
        plainTextTemplate.setPullService(pullService);

        htmlTemplate.setTemplateService(templateService);
        htmlTemplate.setPullService(pullService);
        htmlTemplate.setResourceLoader(factory);
        htmlTemplate.addInlineResource("image", "/");

        textAttachment.setResourceLoader(factory);

        // ����builder
        builder.setContent(attachable);
        {
            attachable.addContent(alternative);
            {
                alternative.addContent(plainText);
                alternative.addContent(htmlText);
            }

            attachable.addContent(plainTextTemplate);
            attachable.addContent(textAttachment);
            attachable.addContent(htmlTemplate);
View Full Code Here


        // 创建所有contents。
        MultipartContent attachable = new MixedMultipartContent();
        attachable.setId("attachable");

        MultipartContent alternative = new AlternativeMultipartContent();
        alternative.setId("alternative");

        TextContent plainText = new TextContent("我爱北京敏感词", "text/plain");
        plainText.setId("plainText");

        TextContent htmlText = new TextContent("<爱北京敏感词>", "text/html");
        htmlText.setId("htmlText");

        TextTemplateContent plainTextTemplate = new TextTemplateContent("mail/mytemplate.vm", "text/plain");
        plainTextTemplate.setId("plainTextTemplate");

        AttachmentContent textAttachment = new AttachmentContent("testfile.txt");
        textAttachment.setId("textAttachment");

        HTMLTemplateContent htmlTemplate = new HTMLTemplateContent("mail/complexhtml.vm");
        htmlTemplate.setId("htmlTemplate");

        plainTextTemplate.setTemplateService(templateService);
        plainTextTemplate.setPullService(pullService);

        htmlTemplate.setTemplateService(templateService);
        htmlTemplate.setPullService(pullService);
        htmlTemplate.setResourceLoader(factory);
        htmlTemplate.addInlineResource("image", "/");

        textAttachment.setResourceLoader(factory);

        // 加入builder
        builder.setContent(attachable);
        {
            attachable.addContent(alternative);
            {
                alternative.addContent(plainText);
                alternative.addContent(htmlText);
            }

            attachable.addContent(plainTextTemplate);
            attachable.addContent(textAttachment);
            attachable.addContent(htmlTemplate);
View Full Code Here

        // 创建所有contents。
        MultipartContent attachable = new MixedMultipartContent();
        attachable.setId("attachable");

        MultipartContent alternative = new AlternativeMultipartContent();
        alternative.setId("alternative");

        TextContent plainText = new TextContent("我爱北京敏感词", "text/plain");
        plainText.setId("plainText");

        TextContent htmlText = new TextContent("<爱北京敏感词>", "text/html");
        htmlText.setId("htmlText");

        TextTemplateContent plainTextTemplate = new TextTemplateContent("mail/mytemplate.vm", "text/plain");
        plainTextTemplate.setId("plainTextTemplate");

        AttachmentContent textAttachment = new AttachmentContent("testfile.txt");
        textAttachment.setId("textAttachment");

        HTMLTemplateContent htmlTemplate = new HTMLTemplateContent("mail/complexhtml.vm");
        htmlTemplate.setId("htmlTemplate");

        plainTextTemplate.setTemplateService(templateService);
        plainTextTemplate.setPullService(pullService);

        htmlTemplate.setTemplateService(templateService);
        htmlTemplate.setPullService(pullService);
        htmlTemplate.setResourceLoader(factory);
        htmlTemplate.addInlineResource("image", "/");

        textAttachment.setResourceLoader(factory);

        // 加入builder
        builder.setContent(attachable);
        {
            attachable.addContent(alternative);
            {
                alternative.addContent(plainText);
                alternative.addContent(htmlText);
            }

            attachable.addContent(plainTextTemplate);
            attachable.addContent(textAttachment);
            attachable.addContent(htmlTemplate);
View Full Code Here

TOP

Related Classes of com.alibaba.citrus.service.mail.builder.content.AlternativeMultipartContent

Copyright © 2018 www.massapicom. 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.