MessageInterface is the interface that should be implemented by mail message classes.
A message represents the settings and content of an email, such as the sender, recipient, subject, body, etc.
Messages are sent by a mailer, like the following,
Yii::$app->mailer->compose()
->setFrom('from@domain.com')
->setTo($form->email)
->setSubject($form->subject)
->setTextBody('Plain text content')
->setHtmlBody('<b>HTML content</b>')
->send();
See also yii\mail\MailerInterface.
Method DetailsAttaches existing file to the email message.
public abstract $this attach ( $fileName, array $options = [] ) $fileName stringFull file name
$options arrayOptions for embed file. Valid options are:
Self reference.
public function attach($fileName, array $options = []);
Attach specified content as file for the email message.
public abstract $this attachContent ( $content, array $options = [] ) $content stringAttachment file content.
$options arrayOptions for embed file. Valid options are:
Self reference.
public function attachContent($content, array $options = []);
Attach a file and return it's CID source.
This method should be used when embedding images or other data in a message.
public abstract string embed ( $fileName, array $options = [] ) $fileName stringFile name.
$options arrayOptions for embed file. Valid options are:
Attachment CID.
public function embed($fileName, array $options = []);
Attach a content as file and return it's CID source.
This method should be used when embedding images or other data in a message.
public abstract string embedContent ( $content, array $options = [] ) $content stringAttachment file content.
$options arrayOptions for embed file. Valid options are:
Attachment CID.
public function embedContent($content, array $options = []);
Returns the Bcc (hidden copy receiver) addresses of this message.
public function getBcc();
Returns the Cc (additional copy receiver) addresses of this message.
Returns the character set of this message.
public function getCharset();
Returns the message sender.
public function getFrom();
Returns the reply-to address of this message.
public function getReplyTo();
Returns the message subject.
public function getSubject();
Sends this email message.
public abstract boolean send ( ?\yii\mail\MailerInterface $mailer = null ) $mailer yii\mail\MailerInterface|nullThe mailer that should be used to send this message. If null, the "mailer" application component will be used instead.
return booleanWhether this message is sent successfully.
public function send(?MailerInterface $mailer = null);
Sets the Bcc (hidden copy receiver) addresses of this message.
public abstract $this setBcc ( $bcc ) $bcc string|arrayHidden copy receiver email address. You may pass an array of addresses if multiple recipients should receive this message. You may also specify receiver name in addition to email address using format: [email => name]
.
Self reference.
public function setBcc($bcc);
Sets the Cc (additional copy receiver) addresses of this message.
public abstract $this setCc ( $cc ) $cc string|arrayCopy receiver email address. You may pass an array of addresses if multiple recipients should receive this message. You may also specify receiver name in addition to email address using format: [email => name]
.
Self reference.
public function setCc($cc);
Sets the character set of this message.
public function setCharset($charset);
Sets the message sender.
public abstract $this setFrom ( $from ) $from string|arraySender email address. You may pass an array of addresses if this message is from multiple people. You may also specify sender name in addition to email address using format: [email => name]
.
Self reference.
public function setFrom($from);
Sets message HTML content.
public function setHtmlBody($html);
Sets the reply-to address of this message.
public abstract $this setReplyTo ( $replyTo ) $replyTo string|arrayThe reply-to address. You may pass an array of addresses if this message should be replied to multiple people. You may also specify reply-to name in addition to email address using format: [email => name]
.
Self reference.
public function setReplyTo($replyTo);
Sets the message subject.
public function setSubject($subject);
Sets message plain text content.
public function setTextBody($text);
Sets the message recipient(s).
public abstract $this setTo ( $to ) $to string|arrayReceiver email address. You may pass an array of addresses if multiple recipients should receive this message. You may also specify receiver name in addition to email address using format: [email => name]
.
Self reference.
public function setTo($to);
Returns string representation of this message.
public function toString();
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4