Package javax.mail.internet

Examples of javax.mail.internet.MimeMessage.removeHeader()


            outgoingMessage.setHeader("List-Id", "<" + listId + ">");
            outgoingMessage.setHeader("List-Post", "<" + address + ">");
            outgoingMessage.removeHeader("List-Help");
            outgoingMessage.removeHeader("List-Unsubscribe");
            outgoingMessage.removeHeader("List-Subscribe");
            outgoingMessage.removeHeader("List-Owner");
            outgoingMessage.removeHeader("List-Archive");

            return outgoingMessage;
        } catch (MessagingException e) {
View Full Code Here


            outgoingMessage.setHeader("List-Id", "<" + listId + ">");
            outgoingMessage.setHeader("List-Post", "<" + address + ">");
            outgoingMessage.removeHeader("List-Help");
            outgoingMessage.removeHeader("List-Unsubscribe");
            outgoingMessage.removeHeader("List-Subscribe");
            outgoingMessage.removeHeader("List-Owner");
            outgoingMessage.removeHeader("List-Archive");

            return outgoingMessage;
        } catch (MessagingException e) {
            logger.error("Cannot create a mail list MimeMessage", e);
View Full Code Here

            outgoingMessage.setHeader("List-Post", "<" + address + ">");
            outgoingMessage.removeHeader("List-Help");
            outgoingMessage.removeHeader("List-Unsubscribe");
            outgoingMessage.removeHeader("List-Subscribe");
            outgoingMessage.removeHeader("List-Owner");
            outgoingMessage.removeHeader("List-Archive");

            return outgoingMessage;
        } catch (MessagingException e) {
            logger.error("Cannot create a mail list MimeMessage", e);
            throw new RejectExceptionExt(
View Full Code Here

        try {
            MimeMessage  message = mail.getMessage();
       
            // loop through the headers
            for (String header : headers) {
                message.removeHeader(header);
            }
           
            message.saveChanges();

        } catch (MessagingException e) {
View Full Code Here

        try {
            MimeMessage  message = mail.getMessage();
       
            // loop through the headers
            for (int i = 0; i < headers.size(); i++) {
                message.removeHeader((String) headers.get(i));
            }
           
            message.saveChanges();

        } catch (MessagingException e) {
View Full Code Here

            }

            //Create a copy of this message to send out
            MimeMessage message = new MimeMessage(mail.getMessage());
            //We need to remove this header from the copy we're sending around
            message.removeHeader(RFC2822Headers.RETURN_PATH);

            //Figure out the listserv address.
            MailAddress listservAddr = getListservAddress();
            if (listservAddr == null) {
                //Use the recipient
View Full Code Here

    protected MimeMessage prepareListMessage(Mail mail, MailAddress listservAddr) throws MessagingException {
        //Create a copy of this message to send out
        MimeMessage message = new MimeMessage(mail.getMessage());

        //We need tao remove this header from the copy we're sending around
        message.removeHeader(RFC2822Headers.RETURN_PATH);

        //We're going to set this special header to avoid bounces
        //  getting sent back out to the list
        message.setHeader("X-been-there", listservAddr.toString());
View Full Code Here

    protected MimeMessage prepareListMessage(Mail mail, MailAddress listservAddr) throws MessagingException {
        //Create a copy of this message to send out
        MimeMessage message = new MimeMessage(mail.getMessage());

        //We need tao remove this header from the copy we're sending around
        message.removeHeader(RFC2822Headers.RETURN_PATH);

        //We're going to set this special header to avoid bounces
        //  getting sent back out to the list
        message.setHeader("X-been-there", listservAddr.toString());
View Full Code Here

            }

            //Create a copy of this message to send out
            MimeMessage message = new MimeMessage(mail.getMessage());
            //We need to remove this header from the copy we're sending around
            message.removeHeader(RFC2822Headers.RETURN_PATH);

            //Figure out the listserv address.
            MailAddress listservAddr = getListservAddress();
            if (listservAddr == null) {
                //Use the recipient
View Full Code Here

                storeMail(mail.getSender(), recipient, message);

                if (deliveryHeader != null) {
                    if (i.hasNext()) {
                        // Remove headers but leave all placeholders
                        message.removeHeader(deliveryHeader);
                        headers = deliveredTo.getAllHeaders();
                        // And restore any original Delivered-To headers
                        while (headers.hasMoreElements()) {
                            Header header = (Header) headers.nextElement();
                            message.addHeader(header.getName(), header
View Full Code Here

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.