public class SMTPRelay extends Object
Definition of an SMTP server that allows jadice server to
send outgoing Message
s.
Secure transport can be enforced by configuring an SMTPS connection and applying additional session parameters as described in the javamail documentation.
Constructor and Description |
---|
SMTPRelay() |
Modifier and Type | Method and Description |
---|---|
Map<String,String> |
getAdditionalSessionProperties() |
javax.mail.internet.InternetAddress |
getAddress() |
String |
getAddressAsString() |
String |
getHostname() |
String |
getPassword() |
String |
getProtocol() |
javax.mail.Session |
getSession() |
String |
getUsername() |
void |
send(javax.mail.internet.MimeMessage message)
Send a message via the specified connection and parameters.
|
void |
setAdditionalSessionProperties(Map<String,String> props)
Apply additional parameters to the underlying javamail
Session . |
void |
setAddress(javax.mail.internet.InternetAddress address) |
void |
setAddressAsString(String address) |
void |
setHostname(String hostname)
Set the SMTP host where to connect to
|
void |
setPassword(String password) |
void |
setProtocol(String protocol)
Alters the transport protocol.
|
void |
setUsername(String username) |
public String getHostname()
public void setHostname(String hostname)
hostname
- hostname, must not be null
.IllegalArgumentException
- if hostname
is null
.public String getProtocol()
public void setProtocol(String protocol)
smtp
or smtps
are reasonable values.
Default value: smtp
protocol
- the transport protocol to useIllegalArgumentException
- if protocol
is null
.public String getUsername()
public void setUsername(String username)
public String getPassword()
public void setPassword(String password)
public javax.mail.internet.InternetAddress getAddress()
public void setAddress(javax.mail.internet.InternetAddress address)
public void setAddressAsString(String address) throws javax.mail.internet.AddressException
javax.mail.internet.AddressException
public String getAddressAsString()
public void setAdditionalSessionProperties(Map<String,String> props)
Session
.props
- additional propertiesIllegalArgumentException
- if props
is null
.public void send(javax.mail.internet.MimeMessage message) throws javax.mail.MessagingException
message
- the message to sendjavax.mail.MessagingException
{@link
- IllegalArgumentException} if message
is nullpublic javax.mail.Session getSession()
Copyright © 2017 levigo holding gmbh. All rights reserved.