Hey! Keep up to date with the project through its beta and public launch by following @getsparks.Tweet
CodeIgniter Starter Project − A Starting Point for Any CI Dev
December 12, 2011
Quickly add SwiftMailer functionality to your CodeIgniter Reactor project.
|: Log in to view|
|Author Website||: http://heybigname.com|
|Spark Website||: https://github.com/heybigname/swift-mailer-spark|
|Repository Type||: git|
|Number of Installs||: 2,731|
php tools/spark install -v0.1.9 swift-mailerOr download this version manually: Get swift-mailer-0.1.9.zip
Swift Mailer is an open source PHP Mailer library.
This spark exists to quickly integrate SwiftMailer's mailing features with CodeIgniter 2.
Navigate to the root of your CodeIgniter project and run
php tools/spark install swift-mailer
SwiftMailer documentation can be found at http://swiftmailer.org.
Throw this into a controller and give it a run. Make sure that the sendmail path is correct.
$this->load->spark('swift-mailer/0.1.9'); // create the transport $transport = Swift_SendmailTransport::newInstance('/usr/sbin/sendmail -bs'); // create the mailer that will use the transport $mailer = Swift_Mailer::newInstance($transport); // create the message $message = Swift_Message::newInstance(); $message->setSubject('test'); $message->setFrom('firstname.lastname@example.org'); $message->setTo(array('email@example.com' => 'Your Name')); $message->setBody('This is the body.'); // send the message $mailer->send($message);
If you prefer to use abstraction mode then configure the spark by editing sparks/swift-mailer/
$this->load->spark('swift-mailer/0.1.9'); $this->swiftmailer->create_message('test_message', 'Test message subject.', 'message body', 'firstname.lastname@example.org', 'email@example.com'); $result = $this->swiftmailer->send_message('test_message');
Swift Mailer was originally created and maintained by Chris Corbyn. Paul Annesley and Christopher Thompson joined the team in 2009. In September of 2009 Fabien Potencier took over maintenance of the project.
php tools/spark install -v0.1.5 swift-mailerOr download this version manually: Get swift-mailer-0.1.5.zip
php tools/spark install -v0.0.1 swift-mailerOr download this version manually: Get swift-mailer-0.0.1.zip