Skip to content

Instantly share code, notes, and snippets.

@rwheaton
Last active September 28, 2015 00:18
Show Gist options
  • Save rwheaton/1355392 to your computer and use it in GitHub Desktop.
Save rwheaton/1355392 to your computer and use it in GitHub Desktop.
swiftmailer test
<?
require_once '/Users/larry/hp/vendors/SwiftMailer/swift_required.php';
//require_once '/home/ryan/Documents/code/houseparty/houseparty/vendors/SwiftMailer/swift_required.php';
//Create the Transport
$transport = Swift_SmtpTransport::newInstance('XX.XX.XX.XX', 25);
//Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
//Create a message
$message = Swift_Message::newInstance('Hi how are you')
->setFrom(array('[email protected]' => 'rtw'))
->setTo(array('[email protected]', '[email protected]' => 'Ryan W'))
->setBody('Here is the message itself')
;
//Send the message
$result = $mailer->send($message);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment