Package overit.geocall.mail
Class SmtpServer
java.lang.Object
overit.geocall.mail.MailServer
overit.geocall.mail.SmtpServer
This class manages all the properties used to send an email such as ssl, port, dns, host, protocol etc.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected intprotected booleanprotected Stringprotected Integerprotected Stringprotected booleanprotected Stringprotected Stringprotected booleanFields inherited from class overit.geocall.mail.MailServer
authenticator -
Constructor Summary
ConstructorsConstructorDescriptionSmtpServer(String host) Creates a new SmtpServerSmtpServer(String protocol, String host) Creates a new SmtpServer -
Method Summary
Modifier and TypeMethodDescriptionbooleangetDsn()Returns if dns capability is abilitatedgetHost()Returns the hostintgetPort()Returns the number of the portReturns the procotolbooleanReturns if send partial capability is abilitatedgetSsl()Returns the sslReturns the timeoutbooleangetTls()Returns the tlsstatic voidvoidSend the email through the smtp servervoidsetDebug(boolean debug) Sets if debug capability should be abilitatedvoidsetPort(int i) Sets the number of the portfinal voidsetProtocol(String protocol) Sets the protocol used by the smtp serverstatic voidSends an email with the info in the configuration fileMethods inherited from class overit.geocall.mail.MailServer
getAuthenticator, setAuthenticator
-
Field Details
-
_protocol
-
_tls
protected boolean _tls -
_ssl
-
_port
-
_host
-
_sendPartial
protected boolean _sendPartial -
_timeout
-
_dsn
protected boolean _dsn -
_debug
protected boolean _debug -
_delay
protected int _delay
-
-
Constructor Details
-
SmtpServer
Creates a new SmtpServer- Parameters:
host- The host of the smtp server
-
SmtpServer
Creates a new SmtpServer- Parameters:
protocol- The protocol used by the smtp serverhost- The host of the smtp server
-
-
Method Details
-
setPort
public void setPort(int i) Sets the number of the port- Parameters:
i- The number of the port
-
getPort
public int getPort()Returns the number of the port- Returns:
- The number of the port
-
setProtocol
Sets the protocol used by the smtp server- Parameters:
protocol- String containing the protocol used by the smtp server
-
getHost
Returns the host- Returns:
- The host
-
getProtocol
Returns the procotol- Returns:
- The protocol
-
getTls
public boolean getTls()Returns the tls- Returns:
- The tls
-
getSsl
Returns the ssl- Returns:
- The ssl
-
getSendPartial
public boolean getSendPartial()Returns if send partial capability is abilitated- Returns:
trueif send partial capability is abilitated,falseotherwise
-
getDsn
public boolean getDsn()Returns if dns capability is abilitated- Returns:
trueif dsn capability is abilitated,falseotherwise
-
getTimeout
Returns the timeout- Returns:
- The timeout
-
setDebug
public void setDebug(boolean debug) Sets if debug capability should be abilitated- Parameters:
debug- Boolean value indicating if debug capability should be abilitated
-
send
Send the email through the smtp server- Specified by:
sendin classMailServer- Parameters:
m- TheMessageto send- Throws:
EmailException- If an error occurs
-
systemSend
Sends an email with the info in the configuration file- Parameters:
m- The message to send- Throws:
EmailException- If an error occurs
-
main
- Throws:
Exception
-