Skip to content

Instantly share code, notes, and snippets.

Created June 3, 2016 10:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/289fe4c637bbac515e19d76b9d811501 to your computer and use it in GitHub Desktop.
Save anonymous/289fe4c637bbac515e19d76b9d811501 to your computer and use it in GitHub Desktop.
if ( $queueMessageCount > self::QUEUE_THRESHOLD_HIGH ){
$logger->debug("found $queueMessageCount messages on rabbitmq .... adding a new node");
// send an email
$mailer = $container->get('mailer');
$transport = \Swift_SmtpTransport::newInstance('smtp', 465, 'ssl')
->setHost("email-smtp.eu-west-1.amazonaws.com")
->setUsername("*********")
->setPassword("*********");
echo "GOT A Transport\n";
$mailer = \Swift_Mailer::newInstance($transport);
echo "GOT A Mailer\n";
$msg = \Swift_Message::newInstance()
->setSubject("Hello World")
->setFrom("validuser@ict.com")
->setTo("sample@gmail.com")
->setBody("<html><head><title>Hello</title></head><body><h1>Hey Howdy!</h1></body></html>", "text/html");
echo "GOT A Message\n";
$mailer->send($msg);
echo "SENT\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment