Attempt to send the email message.

@param string $senderMail
@param string $senderName
@param string $mailhtml
422146
private function sendMessage($senderMail, $senderName, $mailhtml)
    {
        try {
            $message = $this->app['mailer']
                ->createMessage('message')
                ->setSubject('Test email from ' . $this->app['config']->get('general/sitename'))
                ->setFrom([$senderMail                   => $senderName])
                ->setReplyTo([$senderMail                => $senderName])
                ->setTo([$this->options['user']['email'] => $this->options['user']['displayname']])
                ->setBody(strip_tags($mailhtml))
                ->addPart($mailhtml, 'text/html')
            ;

            $this->app['swiftmailer.use_spool'] = false;
            if ($this->app['mailer']->send($message) > 0) {
                $this->createResult()->pass()->setMessage("Message sent to '" . $this->options['user']['email'] . "' from '" . $senderMail . "'.");
            } else {
                $this->createResult()->fail()->setMessage('No messages were able to be sent. Check your configuration.');
            }
        } catch (\Swift_TransportException $e) {
            $this->createResult()->fail()->setMessage('Swiftmailer exception')->setException($e);
        } catch (\Exception $e) {
            $this->createResult()->fail()->setMessage('PHP exception')->setException($e);
        }
    }
876164
public function setSenderName($senderName)
    {
        if ($this->sender == null) {
            $this->sender = new PagSeguroSender();
        }
        $this->sender->setName($senderName);
    }
710807
public function sendMail(Mail $mail) {
		$sender = $mail->getSender();
		if (!$sender instanceof MailAddress) {
			throw new SmtpException('no sender found on mail');
		}
		$this->mail($sender->getEmail());
		
		foreach ($mail->getRecipients() as $address) {
			$address instanceof MailAddress;
			// @todo: catch errors
			$this->recipient($address->getEmail());
		}
		
		$this->data($mail->getData());
	}
404616
public function receiveAnEmailFromEmail($senderEmail)
    {
        $message = $this->fetchLastMessage();
        $this->assertEquals($senderEmail, $message->from_email);
    }
405206
public function defaultMailer($message, string $email): void
    {
        $host = \preg_replace('#[^\w.-]+#', '', $_SERVER['HTTP_HOST'] ?? php_uname('n'));
        $parts = \str_replace(
            ["\r\n", "\n"],
            ["\n", PHP_EOL],
            [
                'headers' => \implode("\n", [
                        'From: ' . ($this->fromEmail ?: "noreply@$host"),
                        'X-Mailer: Tracy',
                        'Content-Type: text/plain; charset=UTF-8',
                        'Content-Transfer-Encoding: 8bit',
                    ]) . "\n",
                'subject' => "PHP: An error occurred on the server $host",
                'body' => Dumper::formatMessage($message) . "\n\nsource: " . Helpers::getSource(),
            ]
        );

        \mail($email, $parts['subject'], $parts['body'], $parts['headers']);
    }
285293
public function setSenderEmailAddress($email)
    {
        if (!$this->validateHeaderFieldValue($email)) {
            throw new EmailValidationException(__('Sender Email Address can not contain carriage return or newlines.'));
        }

        $this->_sender_email_address = $email;
    }
925241
protected function sendEmail($email,$subject,$message)
	{
		$headers=$this->getHeaders();
		if($this->utf8)
		{
			$headers[]="MIME-Version: 1.0";
			$headers[]="Content-Type: text/plain; charset=UTF-8";
			$subject='=?UTF-8?B?'.base64_encode($subject).'?=';
		}
		if(($from=$this->getSentFrom())!==null)
		{
			$matches=array();
			preg_match_all('/([^<]*)<([^>]*)>/iu',$from,$matches);
			if(isset($matches[1][0],$matches[2][0]))
			{
				$name=$this->utf8 ? '=?UTF-8?B?'.base64_encode(trim($matches[1][0])).'?=' : trim($matches[1][0]);
				$from=trim($matches[2][0]);
				$headers[]="From: {$name} <{$from}>";
			}
			else
				$headers[]="From: {$from}";
			$headers[]="Reply-To: {$from}";
		}
		mail($email,$subject,$message,implode("\r\n",$headers));
	}
1207886
public function setSender($sSenderMail, $sSenderName = null)
    {
        $this->aOptions['sender_mail'] = (string)$sSenderMail;

        if ($sSenderName) {
            $this->aOptions['sender_name'] = (string)$sSenderName;
        }

        return $this;
    }
685661
public function postMessage($sender, $recipient, $message)
    {
        if ($this->maxMessages) {
            $statement = $this->connection->prepare(
                'SELECT COUNT(*) FROM "phergie-plugin-tell"
                    WHERE "recipient" = ?;'
            );
            $statement->execute([ $recipient ]);

            if ($statement->fetchColumn(0) >= $this->maxMessages) {
                return false;
            }
        }

        $this->connection->prepare(
            'INSERT INTO "phergie-plugin-tell"
                ("sender", "recipient", "message")
                VALUES (?, ?, ?);'
        )->execute([ $sender, $recipient, $message ]);

        return true;
    }
1159924
protected function sendEmail(MailerInterface $mailer, $address)
    {
        $message = $mailer->compose();
        $message->setTextBody(file_get_contents($this->_output))
            ->setSubject($this->getEmailSubject())
            ->setTo($address);

        $message->send();
    }
459420
public function createMessage($subject = null, $content = null, $html = true)
    {
        $class = $this->messageClass;

        $message = new $class($subject, $content, $html);

        $this->triggerEvent('onMailerAfterCreateMessage', [
            'message' => $message,
            'manager' => $this,
        ]);

        return $message;
    }
936751
public function send(Message $message) : void
    {
        $sender = $this->smtp['sender'];
        $recipients = is_array($sender['to']) ? $sender['to'] : [$sender['to']];

        $message->setFrom($sender['email'], $sender['name']);

        foreach ($recipients as $to)
        {
            $message->addTo($to);
        }

        $mailer = new \Nette\Mail\SmtpMailer($this->smtp['config']);
        $mailer->send($message);
    }
1280146
public function setMail(string $mailPath, bool $mailPanel): void
	{
		$this->mailPath = $mailPath;
		$this->mailPanel = $mailPanel;
	}
189259
public function setSender(
        $name,
        $email = null,
        $areaCode = null,
        $number = null,
        $documentType = null,
        $documentValue = null
    ) {
        $param = $name;
        if (is_array($param)) {
            $this->sender = new PagSeguroSender($param);
        } elseif ($param instanceof PagSeguroSender) {
            $this->sender = $param;
        } else {
            $sender = new PagSeguroSender();
            $sender->setName($param);
            $sender->setEmail($email);
            $sender->setPhone(new PagSeguroPhone($areaCode, $number));
            $sender->addDocument($documentType, $documentValue);
            $this->sender = $sender;
        }
    }
1276873
public function send(PHPMailer $mail)
    {
        if ($template = $this->getOption('subjectTemplate')) {
            /** @var string $template */
            $mail->Subject = Translator::translate($template, $mail->Subject);
        }

        if (!$mail->send()) {
            // Why you don't use "Exception mode" of PHPMailer
            // Because we need our Exception in any case
            throw new MailerException('Error mail send: ' . $mail->ErrorInfo);
        }

        return true;
    }
857164
public static void send(String to, String subject, String content, boolean isHtml, File... files) {
		send(splitAddress(to), subject, content, isHtml, files);
	}
1194963
public void sendEmail(final List<String> emailList, final String subject, final String body) {
    if (emailList != null && !emailList.isEmpty()) {
      final EmailMessage message = super.createEmailMessage(subject, "text/html", emailList);
      message.setBody(body);
      sendEmail(message, true, "email message " + body);
    }
  }