Skip to content

Instantly share code, notes, and snippets.

@ptasker
Last active December 29, 2015 13:49
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 ptasker/7679992 to your computer and use it in GitHub Desktop.
Save ptasker/7679992 to your computer and use it in GitHub Desktop.
Mailgun setup
<?php
require_once 'swiftmailer/lib/swift_required.php';
// Create the Transport
$transport = Swift_SmtpTransport::newInstance ( 'smtp.mailgun.org', 25 )
->setUsername ( 'username@domain.com' )
->setPassword ( 'rand0mpa55' );
//Helps for sending mail locally during development
$transport->setLocalDomain ( '[127.0.0.1]' );
// Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance ( $transport );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment