Package javax.mail.internet

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


            multipart.addBodyPart(part);
            reply.setContent(multipart);
        } catch (Exception ioe) {
            throw new MessagingException("Unable to create multipart body", ioe);
        }
        reply.saveChanges();
        //Send it off...
        sendMail(bouncer, recipients, reply);
    }

    /**
 
View Full Code Here


                        mbp.setFileName(fileName);
                    }
                    mp.addBodyPart(mbp);
                }
                mail.setContent(mp);
                mail.saveChanges();
            } else {
                // create the singelpart message
                if (contentType.startsWith("text")) {
                    mail.setText(body, "UTF-8", contentType.substring(5));
                } else {
View Full Code Here

                if (contentType.startsWith("text")) {
                    mail.setText(body, "UTF-8", contentType.substring(5));
                } else {
                    mail.setContent(body, contentType);
                }
                mail.saveChanges();
            }
        } catch (MessagingException e) {
            String errMsg = "MessagingException when creating message to [" + sendTo + "] from [" + sendFrom + "] cc [" + sendCc + "] bcc [" + sendBcc + "] subject [" + subject + "]";
            Debug.logError(e, errMsg, module);
            Debug.logError("Email message that could not be created to [" + sendTo + "] had context: " + context, module);
View Full Code Here

            }
            sm.setContent(multipart);
        }

        //sm.setReturnOption(SMTPMessage.RETURN_FULL);
        sm.saveChanges();

        return sm;
    }

    private void generateSAXReportStatements(AddressHandler[] addressArr)
View Full Code Here

    public void service(Mail mail) throws MessagingException {
        try {
            MimeMessage message = mail.getMessage();

            if (attachFooter(message)) {
                message.saveChanges();
            } else {
                log("Unable to add footer to mail " + mail.getName());
            }
        } catch (UnsupportedEncodingException e) {
            log("UnsupportedEncoding Unable to add footer to mail "
View Full Code Here

                     }
                     else
                     {
                        transport.connect();
                     }
                     message.saveChanges();

                     if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("Sending message");
                     transport.sendMessage(message, message.getAllRecipients());
                     transport.close();
                     if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("Message sent");
View Full Code Here

            Message message = new MimeMessage(Session.getInstance(
                System.getProperties(), null));
            String messageContentType;

            message.setContent(pkg);
            message.saveChanges();

            // Remove all erroneous headers from the parts
            for (int i = 0;
                 i < pkg.getCount();
                 i++) {
View Full Code Here

        }

        sm.setContent(multipart);

        //sm.setReturnOption(SMTPMessage.RETURN_FULL);
        sm.saveChanges();

        return sm;
    }

    private void generateSAXReportStatements(AddressHandler[] addressArr)
View Full Code Here

        mm.addFrom(new Address[] { new InternetAddress("io@bago.org") });
        mm.addRecipient(RecipientType.TO, new InternetAddress("io@bago.org"));
        mm.setContent("An 8bit encoded body with \u20ACuro symbol.",
                "text/plain; charset=iso-8859-15");
        mm.setHeader("Content-Transfer-Encoding", "8bit");
        mm.saveChanges();

        FakeMailContext FakeMailContext = new FakeMailContext();
        FakeMailContext.getServerInfo();
        FakeMailetConfig mci = new FakeMailetConfig("Test", FakeMailContext);
        mci
View Full Code Here

        mm.addFrom(new Address[] { new InternetAddress("io@bago.org") });
        mm.addRecipient(RecipientType.TO, new InternetAddress("io@bago.org"));
        mm.setContent("An 8bit encoded body with \u20ACuro symbol.",
                "text/plain; charset=iso-8859-15");
        mm.setHeader("Content-Transfer-Encoding", "8bit");
        mm.saveChanges();

        FakeMailContext FakeMailContext = new FakeMailContext();
        FakeMailContext.getServerInfo();
        FakeMailetConfig mci = new FakeMailetConfig("Test", FakeMailContext);
        mci
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.