Message

class OC\Mail\Message
Class Message provides a wrapper around SwiftMail
Source:lib/private/Mail/Message.php#45
Implements:OCP\Mail\IMessage

Properties

Methods

public OC\Mail\Message::__construct($swiftMessage, $plainTextOnly)
Source:lib/private/Mail/Message.php#51
public OC\Mail\Message::attach($attachment)
Source:

lib/private/Mail/Message.php#61

Parameters:
Returns:

$this

Since:

13.0.0

protected OC\Mail\Message::convertAddresses($addresses)
SwiftMailer does currently not work with IDN domains, this function therefore converts the domains
FIXME: Remove this once SwiftMailer supports IDN
Source:

lib/private/Mail/Message.php#74

Parameters:
  • $addresses (array) Array of mail addresses, key will get converted
Returns:

array Converted addresses if `idn_to_ascii` exists

public OC\Mail\Message::setFrom($addresses)
Set the from address of this message.
If no “From” address is used \OC\Mail\Mailer will use mail_from_address and mail_domain from config.php
Source:

lib/private/Mail/Message.php#104

Parameters:
Returns:

$this

public OC\Mail\Message::getFrom()
Get the from address of this message.
Source:lib/private/Mail/Message.php#116
Returns:array
public OC\Mail\Message::setReplyTo($addresses)
Set the Reply-To address of this message
Source:

lib/private/Mail/Message.php#126

Parameters:
  • $addresses (array)
Returns:

$this

public OC\Mail\Message::getReplyTo()
Returns the Reply-To address of this message
Source:lib/private/Mail/Message.php#138
Returns:string
public OC\Mail\Message::setTo($recipients)
Set the to addresses of this message.
Source:

lib/private/Mail/Message.php#148

Parameters:
Returns:

$this

public OC\Mail\Message::getTo()
Get the to address of this message.
Source:lib/private/Mail/Message.php#160
Returns:array
public OC\Mail\Message::setCc($recipients)
Set the CC recipients of this message.
Source:

lib/private/Mail/Message.php#170

Parameters:
Returns:

$this

public OC\Mail\Message::getCc()
Get the cc address of this message.
Source:lib/private/Mail/Message.php#182
Returns:array
public OC\Mail\Message::setBcc($recipients)
Set the BCC recipients of this message.
Source:

lib/private/Mail/Message.php#192

Parameters:
Returns:

$this

public OC\Mail\Message::getBcc()
Get the Bcc address of this message.
Source:lib/private/Mail/Message.php#204
Returns:array
public OC\Mail\Message::setSubject($subject)
Set the subject of this message.
Source:

lib/private/Mail/Message.php#214

Parameters:
  • $subject (string)
Returns:

\OCP\Mail\IMessage

public OC\Mail\Message::getSubject()
Get the from subject of this message.
Source:lib/private/Mail/Message.php#224
Returns:string
public OC\Mail\Message::setPlainBody($body)
Set the plain-text body of this message.
Source:

lib/private/Mail/Message.php#234

Parameters:
  • $body (string)
Returns:

$this

public OC\Mail\Message::getPlainBody()
Get the plain body of this message.
Source:lib/private/Mail/Message.php#244
Returns:string
public OC\Mail\Message::setHtmlBody($body)
Set the HTML body of this message. Consider also sending a plain-text body instead of only an HTML one.
Source:

lib/private/Mail/Message.php#254

Parameters:
  • $body (string)
Returns:

$this

public OC\Mail\Message::setSwiftMessage($swiftMessage)
Get’s the underlying SwiftMessage
Source:

lib/private/Mail/Message.php#265

Parameters:
  • $swiftMessage (Swift_Message)
public OC\Mail\Message::getSwiftMessage()
Get’s the underlying SwiftMessage
Source:lib/private/Mail/Message.php#273
Returns:\Swift_Message
public OC\Mail\Message::setBody($body, $contentType)
Source:

lib/private/Mail/Message.php#282

Parameters:
  • $body (string)
  • $contentType (string)
Returns:

$this

public OC\Mail\Message::useTemplate($emailTemplate)
Source:

lib/private/Mail/Message.php#293

Parameters:
Returns:

$this