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
Esempio 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);
 }
Esempio n. 2
0
 public function encoderProvider()
 {
     \Webiny\Component\Mailer\Mailer::setConfig(__DIR__ . '/../../' . self::CONFIG);
     return [[new Message(), '7bit'], [new Message(), '8bit'], [new Message(), 'base64']];
 }
Esempio n. 3
0
 public function setUp()
 {
     Mailer::setConfig(realpath(__DIR__ . '/' . self::CONFIG));
 }
Esempio 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);
 }