Skip to content

Instantly share code, notes, and snippets.

@aymanfarhat
Created August 19, 2014 19:32
Show Gist options
  • Save aymanfarhat/2333eadbb1f919fdb8d2 to your computer and use it in GitHub Desktop.
Save aymanfarhat/2333eadbb1f919fdb8d2 to your computer and use it in GitHub Desktop.
$to = array('ayman@test.com');
// setup Swift mailer parameters
$transport = Swift_SmtpTransport::newInstance( 'smtp.sendgrid.net', 465, 'ssl');
$transport->setUsername('aymanfarhat ');
$transport->setPassword('mypass');
$swift = Swift_Mailer::newInstance( $transport );
// create a message (subject)
$message = new Swift_Message('testing swift mail');
// attach the body of the email
$message->setFrom('ayman@wamda.com');
$message->setBody( 'test test', 'text/html' );
$message->setTo( $to );
// send email
$swift->send($message);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment