Package com.mchange.net
Class SmtpMailSender
- java.lang.Object
-
- com.mchange.net.SmtpMailSender
-
- All Implemented Interfaces:
MailSender
public class SmtpMailSender extends java.lang.Object implements MailSender
-
-
Constructor Summary
Constructors Constructor Description SmtpMailSender(java.lang.String host)
SmtpMailSender(java.lang.String host, int port)
SmtpMailSender(java.net.InetAddress hostAddr)
SmtpMailSender(java.net.InetAddress hostAddr, int port)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
main(java.lang.String[] argv)
void
sendMail(java.lang.String from, java.lang.String[] to, java.lang.String[] cc, java.lang.String[] bcc, java.lang.String subject, java.lang.String body)
cc and bcc may be null.void
sendMail(java.lang.String from, java.lang.String[] to, java.lang.String[] cc, java.lang.String[] bcc, java.lang.String subject, java.lang.String body, java.lang.String enc)
cc and bcc may be null.
-
-
-
Constructor Detail
-
SmtpMailSender
public SmtpMailSender(java.net.InetAddress hostAddr, int port)
-
SmtpMailSender
public SmtpMailSender(java.net.InetAddress hostAddr)
-
SmtpMailSender
public SmtpMailSender(java.lang.String host, int port) throws java.net.UnknownHostException
- Throws:
java.net.UnknownHostException
-
SmtpMailSender
public SmtpMailSender(java.lang.String host) throws java.net.UnknownHostException
- Throws:
java.net.UnknownHostException
-
-
Method Detail
-
sendMail
public void sendMail(java.lang.String from, java.lang.String[] to, java.lang.String[] cc, java.lang.String[] bcc, java.lang.String subject, java.lang.String body, java.lang.String enc) throws java.io.IOException, ProtocolException, java.io.UnsupportedEncodingException
Description copied from interface:MailSender
cc and bcc may be null.- Specified by:
sendMail
in interfaceMailSender
- Throws:
java.io.IOException
ProtocolException
java.io.UnsupportedEncodingException
-
sendMail
public void sendMail(java.lang.String from, java.lang.String[] to, java.lang.String[] cc, java.lang.String[] bcc, java.lang.String subject, java.lang.String body) throws java.io.IOException, ProtocolException
Description copied from interface:MailSender
cc and bcc may be null. Uses the default encoding...- Specified by:
sendMail
in interfaceMailSender
- Throws:
java.io.IOException
ProtocolException
-
main
public static void main(java.lang.String[] argv)
-
-