public void connect(final String mailHost, final int mailPort, final String mailUser, final String mailPassword) throws MessagingException { this.t.connect(mailHost, mailPort, mailUser, mailPassword); }
public void sendMessage(final Message message, final Address[] recipients) throws MessagingException { this.t.sendMessage(message, recipients); }
public void close() throws MessagingException { this.t.close(); }
SMTPTransport t = (SMTPTransport)session.getTransport("smtps"); t.connect("smtp.gmail.com", "admin@tovare.com", "<insert password here>"); t.sendMessage(msg, msg.getAllRecipients()); System.out.println("Response: " + t.getLastServerResponse()); t.close();
t.connect("smtp.gmail.com", username, password); t.sendMessage(msg, msg.getAllRecipients()); t.close();
transport.connect(host, port, userEmail, emptyPassword); response = BASE64EncoderStream.encode(response); transport.issueCommand("AUTH XOAUTH2 " + new String(response), 235); else message.setRecipient(Message.RecipientType.TO, new InternetAddress(recipients)); smtpTransport.sendMessage(message, message.getAllRecipients());
/** * Terminate the sent data. * * @exception IOException for I/O errors * @exception MessagingException for other failures * @since JavaMail 1.4.1 */ protected void finishData() throws IOException, MessagingException { assert Thread.holdsLock(this); dataStream.ensureAtBOL(); issueSendCommand(".", 250); }
/** * Sends command <code>cmd</code> to the server terminating * it with <code>CRLF</code>. * * @param cmd the command * @exception MessagingException for failures * @since JavaMail 1.4.1 */ protected void sendCommand(String cmd) throws MessagingException { sendCommand(toBytes(cmd)); }
/** * Issue the <code>HELO</code> command. * * @param domain our domain * @exception MessagingException for failures * @since JavaMail 1.4.1 */ protected void helo(String domain) throws MessagingException { if (domain != null) issueCommand("HELO " + domain, 250); else issueCommand("HELO", 250); }
private synchronized DigestMD5 getMD5() { if (md5support == null) md5support = new DigestMD5(logger); return md5support; }
Message mailMessage = new SMTPMessage(session); Address from = new InternetAddress("remusic_log@163.com"); mailMessage.setFrom(from);
/** * Flush this output stream. * * @exception IOException for I/O errors */ @Override public void flush() throws IOException { bdat(buf, 0, count, false); count = 0; }
/** * Writes the specified <code>byte</code> to this output stream. * * @param b the byte to write * @exception IOException for I/O errors */ @Override public void write(int b) throws IOException { buf[count++] = (byte)b; if (count >= buf.length) flush(); }
/** * Create a BDATOutputStream that wraps a ChunkedOutputStream * of the given size and built on top of the specified * underlying output stream. * * @param out the underlying output stream * @param size the chunk size */ public BDATOutputStream(OutputStream out, int size) { super(new ChunkedOutputStream(out, size)); }
createSession(); transport = new com.sun.mail.smtp.SMTPTransport(session, url); transport.connect(host, port, username, password); for (MimeMessage message : messages) {
/** * Terminate the sent data. * * @exception IOException for I/O errors * @exception MessagingException for other failures * @since JavaMail 1.4.1 */ protected void finishData() throws IOException, MessagingException { assert Thread.holdsLock(this); dataStream.ensureAtBOL(); issueSendCommand(".", 250); }
public void connect() throws MessagingException { this.t.connect(); }
/** * Issue the <code>HELO</code> command. * * @param domain our domain * @exception MessagingException for failures * @since JavaMail 1.4.1 */ protected void helo(String domain) throws MessagingException { if (domain != null) issueCommand("HELO " + domain, 250); else issueCommand("HELO", 250); }
private synchronized DigestMD5 getMD5() { if (md5support == null) md5support = new DigestMD5(logger); return md5support; }
/** * Close this output stream. * * @exception IOException for I/O errors */ @Override public void close() throws IOException { bdat(buf, 0, count, true); count = 0; }