Skip to content

Instantly share code, notes, and snippets.

@dhrrgn
Created September 22, 2011 17:47
Show Gist options
  • Save dhrrgn/1235456 to your computer and use it in GitHub Desktop.
Save dhrrgn/1235456 to your computer and use it in GitHub Desktop.
DI Example
<?php
class Foo extends Container {
public function send_mail()
{
$transport = Swift_MailTransport::newInstance();
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance('Wonderful Subject')
->setFrom(array('[email protected]' => 'John Doe'))
->setTo(array('[email protected]', '[email protected]' => 'A name'))
->setBody('Here is the message itself');
return $mailer->send($message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment