private function sendMail() { $mailTransport = new MailTransport('mail'); $mail = new Mail($mailTransport->conf()); $mail->setSubject('Registration successful')->setFrom($mail->getAdminEmail())->setTo($this->email)->setBody("Welcome {$this->login} on {$this->view->getSiteTitle()}.\n" . "Thank you for registering at our site. You can find your credentials below:\n" . "Login: {$this->login}\nPassword: {$this->password}\nEmail: {$this->email}"); $mail->send(); }
/** * * @param Command $command */ private function sendMail(Command $command) { $login = $command->entity()->getLogin(); $transport = new MailTransport('mail'); $mail = new Mail($transport->conf()); $mail->setSubject('Remind password')->setFrom($mail->getAdminEmail())->setTo($this->http->request->get('userEmail'))->setBody("Dear {$login}\n" . "Your new password is: {$this->randomPassword}\n" . "You can change it later in your user account."); $mail->send(); }
public function testGetAdminEmail() { $this->assertEquals('*****@*****.**', $this->mail->getAdminEmail()); }
<?php use Mail\Mail; require '../vendor/autoload.php'; $loader = new Twig_Loader_Filesystem('../views/twig'); $twig = new Twig_Environment($loader, array('cache' => false)); $mail = new Mail(); if (isset($_POST['from'])) { $mail->writeMail($_POST); $mail->sendMail(); } echo $twig->render("form.twig"); use Mailgun\Mailgun; # Instantiate the client. $mgClient = new Mailgun('key-3c246e362731a7f0458f67ea00e31479'); # Issue the call to the client. $result = $mgClient->post("routes", array('priority' => 0, 'expression' => 'match_recipient(".*@sandboxbcb41bc62f6d485e9e43ef8edb592f7b.mailgun.org")', 'action' => array('forward("*****@*****.**")', 'stop()'), 'description' => 'Sample route'));