Sends the message.
public send ( Webiny\Component\Mailer\MessageInterface $message, null | array &$failures = null ) : boolean | integer | ||
$message | Webiny\Component\Mailer\MessageInterface | Message you want to send. |
$failures | null | array | To this array failed addresses will be stored. |
return | boolean | integer | Number of success sends, or bool FALSE if sending failed. |
public function testSend() { $mailer = new Mailer(); $message = $mailer->getMessage(); $message->setTo(new Email('*****@*****.**', 'Webiny'))->setBody('Testing')->setSubject('PHPUnit test'); $result = $mailer->send($message); $this->assertNotFalse($result); // this test might fail if sendmail is not configured }