SOAPMailSender

public class SOAPMailSender extends MailSender

SOAPMailSender is a mail sender responsible for sending SOAP message.

Author:Hugo Y. K. Lam

Constructors

SOAPMailSender

public SOAPMailSender(String host)

Creates a new instance of SOAPMailSender.

Parameters:
  • host – the mail host.

SOAPMailSender

public SOAPMailSender(String protocol, String host)

Creates a new instance of SOAPMailSender.

Parameters:
  • protocol – the mail protocol.
  • host – the mail host.

SOAPMailSender

public SOAPMailSender(String host, String username, String password)

Creates a new instance of SOAPMailSender.

Parameters:
  • host – the mail host.
  • username – the user name for authentication.
  • password – the password for authentication.

SOAPMailSender

public SOAPMailSender(String protocol, String host, String username, String password)

Creates a new instance of SOAPMailSender.

Parameters:
  • protocol – the mail protocol.
  • host – the mail host.
  • username – the user name for authentication.
  • password – the password for authentication.

Methods

createMessage

public MimeMessage createMessage(String from, String to, String cc, String subject, SOAPMessage soapMessage)

Creates a MIME message from a SOAP message.

Parameters:
  • from – the ‘from’ mail address.
  • to – the ‘to’ mail address(es).
  • cc – the ‘cc’ mail address(es).
  • subject – the mail subject.
  • soapMessage – the SOAP message.
Throws:
Returns:

a new MIME message.

See also: hk.hku.cecid.piazza.commons.net.MailSender.createMessage(java.lang.String,java.lang.String,java.lang.String,java.lang.String,javax.mail.Session)

createMessage

public MimeMessage createMessage(String from, String to, String cc, String subject, SOAPMessage soapMessage, Session session)

Creates a MIME message from a SOAP message.

Parameters:
  • from – the ‘from’ mail address.
  • to – the ‘to’ mail address(es).
  • cc – the ‘cc’ mail address(es).
  • subject – the mail subject.
  • soapMessage – the SOAP message.
  • session – the mail session.
Throws:
Returns:

a new MIME message.

See also: hk.hku.cecid.piazza.commons.net.MailSender.createMessage(java.lang.String,java.lang.String,java.lang.String,java.lang.String,javax.mail.Session)

send

public void send(String from, String to, String cc, String subject, SOAPMessage soapMessage)

Sends a SOAP message.

Parameters:
  • from – the ‘from’ mail address.
  • to – the ‘to’ mail address(es).
  • cc – the ‘cc’ mail address(es).
  • subject – the mail subject.
  • soapMessage – the SOAP message.
Throws:

See also: hk.hku.cecid.piazza.commons.net.MailSender.send(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)