Created
September 22, 2011 17:47
-
-
Save dhrrgn/1235456 to your computer and use it in GitHub Desktop.
DI Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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