Package com.sun.mail.smtp

Examples of com.sun.mail.smtp.SMTPTransport.connect()


          e);
    }

    // Connect to the transport.
    try {
      transport.connect();
    }
    catch(MessagingException e) {
      throw new OmhException("Could not connect to the mail server.", e);
    }
   
View Full Code Here


        SMTPTransport smtp = (SMTPTransport)session.getTransport("smtps");

        String userName = config.getProperty("custom.userName");
        String password = config.getProperty("custom.password");
        
        smtp.connect("smtp.gmail.com", userName, password);
        smtp.sendMessage(message, message.getAllRecipients());     
        smtp.close();
    }
}
View Full Code Here

        SMTPTransport smtp = (SMTPTransport)session.getTransport("smtps");

        String userName = config.getProperty("custom.userName");
        String password = config.getProperty("custom.password");
        
        smtp.connect("smtp.gmail.com", userName, password);
        smtp.sendMessage(message, message.getAllRecipients());     
        smtp.close();
    }
}
View Full Code Here

                    msg.setContent(message, "text/html; charset=utf-8");
                    msg.setSentDate(new Date());

                    SMTPTransport t = (SMTPTransport)session.getTransport("smtps");

                    t.connect("smtp.gmail.com", username, password);
                    t.sendMessage(msg, msg.getAllRecipients());     
                    t.close();
                } catch (MessagingException ex) {
                    Logger.getLogger(Email.class.getName()).log(Level.SEVERE, null, ex);
                } catch (UnsupportedEncodingException ex) {
View Full Code Here

                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

                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

                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

                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

                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

        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

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.