<?php /** * Fuel is a fast, lightweight, community driven PHP5 framework. * * @package Fuel * @version 1.0 * @author Fuel Development Team * @license MIT License * @copyright 2010 - 2011 Fuel Development Team * @link [url=http://fuelphp.com]http://fuelphp.com[/url] */ require_once __DIR__.'/lib/swift_required.php'; /* End of file bootstrap.php */
'packages' => array( 'auth', 'swift' //'orm', ),
class Controller_Testmail extends Controller { /** * The index action. * * @access public * @return void */ public function action_index() { $Transport = Swift_MailTransport::newInstance(); $Mailer = Swift_Mailer::newInstance($Transport); $message = Swift_Message::newInstance() //Give the message a subject ->setSubject('Test subject') //Set the From address with an associative array ->setFrom(array('local1@localhost.com' => 'Local1 Localhost')) //Set the To addresses with an associative array ->setTo(array('info@localhost.com' => 'Test Name')) //Give it a body ->setBody('Here is the message itself') //And optionally an alternative body ->addPart('<p style="color: #336699;"><q>Here is the message itself in it\'s various guises</q></p>', 'text/html') //Optionally add any attachments //->attach(Swift_Attachment::fromPath('my-document.pdf')) ; $Mailer->send($message); $this->response->body = View::factory('welcome/index'); } }
It looks like you're new here. If you want to get involved, click one of these buttons!