Webiny\Component\Mailer\Mailer::send PHP 메소드

send() 공개 메소드

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.
리턴 boolean | integer Number of success sends, or bool FALSE if sending failed.
    public function send(MessageInterface $message, &$failures = null)
    {
        return $this->transport->send($message, $failures);
    }

Usage Example

예제 #1
0
 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
 }