Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.util
Class SmtpProxy

java.lang.Object
  extended by com.jivesoftware.util.SmtpProxy

public class SmtpProxy
extends java.lang.Object

A simple class that handles the work of connecting to an SMTP server to send an email message.


Constructor Summary
SmtpProxy()
          Create a new instance.
 
Method Summary
 javax.mail.internet.MimeMessage createMessage()
          Create a new MimeMessage.
 void send(java.util.List messages)
          Send messages.
 void setDebugEnabled(boolean debugEnabled)
          Toggles SMTP transport layer debugging on or off.
 void setHost(java.lang.String host)
          Sets the SMTP host (eg mail.example.com).
 void setPassword(java.lang.String password)
          Sets the username that will be used when connecting to the SMTP server.
 void setPort(int port)
          Sets the port number that will be used when connecting to the SMTP server.
 void setSSLEnabled(boolean SSLEnabled)
          Sets whether this gateway is configured for SSL connections to the SMTP server or not.
 void setUsername(java.lang.String username)
          Sets the username that will be used when connecting to the SMTP server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmtpProxy

public SmtpProxy()
Create a new instance.

Method Detail

setHost

public void setHost(java.lang.String host)
Sets the SMTP host (eg mail.example.com). The host is null by default, but must be set before gateway exports can execute.

Parameters:
host - The SMTP host.

setPort

public void setPort(int port)
Sets the port number that will be used when connecting to the SMTP server. The default is 25, the standard SMTP port number.

Parameters:
port - The SMTP port number.

setUsername

public void setUsername(java.lang.String username)
Sets the username that will be used when connecting to the SMTP server. The default is null, or no username.

Parameters:
username - The SMTP username.

setPassword

public void setPassword(java.lang.String password)
Sets the username that will be used when connecting to the SMTP server. The default is null, or no username.

Parameters:
password - The SMTP password.

setDebugEnabled

public void setDebugEnabled(boolean debugEnabled)
Toggles SMTP transport layer debugging on or off. Debug information is written to System.out by the underlying JavaMail provider.

Parameters:
debugEnabled - True if SMTP debugging should be enabled.

setSSLEnabled

public void setSSLEnabled(boolean SSLEnabled)
Sets whether this gateway is configured for SSL connections to the SMTP server or not.

Parameters:
SSLEnabled - True if ssl should be enabled, false otherwise.

createMessage

public javax.mail.internet.MimeMessage createMessage()
Create a new MimeMessage.

Returns:
MimeMessage A new message object.

send

public void send(java.util.List messages)
          throws javax.mail.MessagingException
Send messages.

Parameters:
messages - The mail objects to send.
Throws:
javax.mail.MessagingException - If a connection was unable to be established.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.