This class provides access to mail Transport and mail Message object. Use the getMessage to create an email message, and then use the send method to send it using the Transport object.
Inheritance: use trait Webiny\Component\StdLib\StdLibTrait, use trait Webiny\Component\StdLib\ComponentTrait
Ejemplo n.º 1
0
 /**
  * Get the name of bridge library which will be used as the driver.
  *
  * @param string $mailer
  *
  * @return string
  */
 protected static function getLibrary($mailer)
 {
     return Mailer::getConfig()->get('Bridge.' . $mailer, self::$library);
 }
Ejemplo n.º 2
0
 public function encoderProvider()
 {
     \Webiny\Component\Mailer\Mailer::setConfig(__DIR__ . '/../../' . self::CONFIG);
     return [[new Message(), '7bit'], [new Message(), '8bit'], [new Message(), 'base64']];
 }
Ejemplo n.º 3
0
 public function setUp()
 {
     Mailer::setConfig(realpath(__DIR__ . '/' . self::CONFIG));
 }
Ejemplo n.º 4
0
 public function testConfigContent()
 {
     $this->assertSame('nikola@localhost', Mailer::getConfig()->Default->Sender->Email);
     $this->assertSame('\\Webiny\\Component\\Mailer\\Bridge\\SwiftMailer\\SwiftMailer', Mailer::getConfig()->Bridge->Default);
 }