ez projects / ezswift
| UNIX name | Owner | Status | Version | Compatible with |
|---|---|---|---|---|
| ezswift | Kristof Coomans | alpha | 0.1 | 3.9, 3.10 |
Take a look at the Swift website for more information.
include_once( 'extension/ezswift/classes/ezswift.php' ); include_once( 'extension/ezswift/swift/lib/Swift.php' ); $senderEmail = 'sender@example.com'; $receiverEmail = 'receiver@example.com'; $connection = eZSwift::getConnection( $senderEmail ); $swift =& new Swift( $connection ); //Create a message $message =& new Swift_Message( 'Testing Swift' ); include_once( 'lib/version.php' ); $version = eZPublishSDK::version(); $message->headers->set( 'User-Agent', "eZ Publish, version $version" ); //Add plain text and html 'parts' $message->attach( new Swift_Message_Part( 'Part 1 of message' )); $message->attach( new Swift_Message_Part( 'Part <strong>2</strong> of message', 'text/html' ) ); //Add attachment $file =& new Swift_File( ''README.txt ); $attachment =& new Swift_Message_Attachment( $file ); $message->attach( $attachment ); if ( $swift->send( $message, $receiverEmail, $senderEmail ) ) { //Send succesfully } else { }