Examples of SMTPTransport


Examples of com.sun.mail.smtp.SMTPTransport

        msg.setSubject(title);
        msg.setText(message, "utf-8");
        msg.setSentDate(new Date());


        SMTPTransport t = (SMTPTransport)session.getTransport("smtp");
        if (useSSL)
            t = (SMTPTransport)session.getTransport("smtps");
       
        t.connect(userPrefs.getOutgoingMailServer(), userPrefs.getSmtpUsername(), userPrefs.getSmtpPassword());
        t.sendMessage(msg, msg.getAllRecipients());     
        t.close();
    }
View Full Code Here

Examples of com.sun.mail.smtp.SMTPTransport

    msg.setSentDate(new java.util.Date());
    msg.setContent(content,"text/html;charset=big5");
  }

  private void setSMTPServer(String host,int port,  String user,String password) throws Exception{
    tr = new SMTPTransport(sn,new URLName(host));
    tr.connect(host,port,null,null);
   
  }
View Full Code Here

Examples of com.sun.mail.smtp.SMTPTransport

    baseMsg.setSubject("Test Big attached file message");
    baseMsg.setContent(multipart);
        baseMsg.saveChanges();

        log.debug("Send started");
        Transport t = new SMTPTransport(session, new URLName("smtp://localhost:"+SMTP_PORT));
    long started = System.currentTimeMillis();
        t.connect();
        t.sendMessage(baseMsg, new Address[] {new InternetAddress(
        "success@subethamail.org")});
        t.close();
        started = System.currentTimeMillis() - started;
        log.info("Elapsed ms = "+started);

        WiserMessage msg = this.server.getMessages().get(0);
View Full Code Here

Examples of com.sun.mail.smtp.SMTPTransport

                msg.setSubject(subject);
                msg.setSentDate(new Date());
                msg.setContent(content, "text/plain");
                msg.saveChanges();

                SMTPTransport smtpTrans = null;
                if (_smtpUseAuth) {
                    smtpTrans = new SMTPSSLTransport(_smtpSession, new URLName("smtp", _smtpHost, _smtpPort, null, _smtpUsername, _smtpPassword));
                } else {
                    smtpTrans = new SMTPTransport(_smtpSession, new URLName("smtp", _smtpHost, _smtpPort, null, _smtpUsername, _smtpPassword));
                }
                smtpTrans.connect();
                smtpTrans.sendMessage(msg, msg.getAllRecipients());
                smtpTrans.close();
            }
        }
View Full Code Here

Examples of com.sun.mail.smtp.SMTPTransport

                msg.setSubject("You are invited to join the cloud stack project id=" + projectId);
                msg.setSentDate(new Date(DateUtil.currentGMTTime().getTime() >> 10));
                msg.setContent(content, "text/plain");
                msg.saveChanges();

                SMTPTransport smtpTrans = null;
                if (_smtpUseAuth) {
                    smtpTrans = new SMTPSSLTransport(_smtpSession, new URLName("smtp", _smtpHost, _smtpPort, null, _smtpUsername, _smtpPassword));
                } else {
                    smtpTrans = new SMTPTransport(_smtpSession, new URLName("smtp", _smtpHost, _smtpPort, null, _smtpUsername, _smtpPassword));
                }
                smtpTrans.connect();
                smtpTrans.sendMessage(msg, msg.getAllRecipients());
                smtpTrans.close();
            } else {
                throw new CloudRuntimeException("Unable to send email invitation; smtp ses");
            }
        }
View Full Code Here

Examples of com.sun.mail.smtp.SMTPTransport

                msg.setSubject(subject);
                msg.setSentDate(new Date());
                msg.setContent(content, "text/plain");
                msg.saveChanges();

                SMTPTransport smtpTrans = null;
                if (_smtpUseAuth) {
                    smtpTrans = new SMTPSSLTransport(_smtpSession, new URLName("smtp", _smtpHost, _smtpPort, null, _smtpUsername, _smtpPassword));
                } else {
                    smtpTrans = new SMTPTransport(_smtpSession, new URLName("smtp", _smtpHost, _smtpPort, null, _smtpUsername, _smtpPassword));
                }
                sendMessage(smtpTrans, msg);
            }
        }
View Full Code Here

Examples of com.sun.mail.smtp.SMTPTransport

                msg.setSubject("You are invited to join the cloud stack project id=" + projectId);
                msg.setSentDate(new Date(DateUtil.currentGMTTime().getTime() >> 10));
                msg.setContent(content, "text/plain");
                msg.saveChanges();

                SMTPTransport smtpTrans = null;
                if (_smtpUseAuth) {
                    smtpTrans = new SMTPSSLTransport(_smtpSession, new URLName("smtp", _smtpHost, _smtpPort, null, _smtpUsername, _smtpPassword));
                } else {
                    smtpTrans = new SMTPTransport(_smtpSession, new URLName("smtp", _smtpHost, _smtpPort, null, _smtpUsername, _smtpPassword));
                }
                smtpTrans.connect();
                smtpTrans.sendMessage(msg, msg.getAllRecipients());
                smtpTrans.close();
            } else {
                throw new CloudRuntimeException("Unable to send email invitation; smtp ses");
            }
        }
View Full Code Here

Examples of com.sun.mail.smtp.SMTPTransport

                msg.setSubject(subject);
                msg.setSentDate(new Date());
                msg.setContent(content, "text/plain");
                msg.saveChanges();

                SMTPTransport smtpTrans = null;
                if (_smtpUseAuth) {
                    smtpTrans = new SMTPSSLTransport(_smtpSession, new URLName("smtp", _smtpHost, _smtpPort, null, _smtpUsername, _smtpPassword));
                } else {
                    smtpTrans = new SMTPTransport(_smtpSession, new URLName("smtp", _smtpHost, _smtpPort, null, _smtpUsername, _smtpPassword));
                }
                smtpTrans.connect();
                smtpTrans.sendMessage(msg, msg.getAllRecipients());
                smtpTrans.close();
            }
        }
View Full Code Here

Examples of com.sun.mail.smtp.SMTPTransport

                msg.setSubject(subject);
                msg.setSentDate(new Date());
                msg.setContent(content, "text/plain");
                msg.saveChanges();

                SMTPTransport smtpTrans = null;
                if (_smtpUseAuth) {
                    smtpTrans = new SMTPSSLTransport(_smtpSession, new URLName("smtp", _smtpHost, _smtpPort, null, _smtpUsername, _smtpPassword));
                } else {
                    smtpTrans = new SMTPTransport(_smtpSession, new URLName("smtp", _smtpHost, _smtpPort, null, _smtpUsername, _smtpPassword));
                }
                smtpTrans.connect();
                smtpTrans.sendMessage(msg, msg.getAllRecipients());
                smtpTrans.close();
            }
        }
View Full Code Here

Examples of com.sun.mail.smtp.SMTPTransport

      MimeBodyPart mbp1 = new MimeBodyPart();
      mbp1.setText(message, "UTF8");
      MimeMultipart mp = new MimeMultipart();
      mp.addBodyPart(mbp1);
      msg.setContent(mp);
      SMTPTransport t = (SMTPTransport)s.getTransport("smtp");
      try {
        t.connect("mail.intelclinic.ru", "support@intelclinic.ru", "mysupport");
        t.sendMessage(msg, msg.getAllRecipients());
      } finally {
        t.close();
      }

    }
    catch (MessagingException ex) {
      MessageBox.asyncShowExceptionOnly(ex, false);
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.