Skip to content

Instantly share code, notes, and snippets.

@suzuki
Created February 2, 2014 23:50
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 suzuki/8776883 to your computer and use it in GitHub Desktop.
Save suzuki/8776883 to your computer and use it in GitHub Desktop.
Swift Mailer sample / normail email
<?php
require 'vendor/autoload.php';
$transport = Swift_SmtpTransport::newInstance('localhost', 25);
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance();
$message
->setFrom(['suzuki@example.com'])
->setTo(['YOUR_GMAIL_ADDRESS'])
->setSubject('テストメール')
->setBody('テストメール本文')
;
$result = $mailer->send($message);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment