We have added this library to all our servers, so now you can use it without having to upload it to the server. Here are the steps to use it:
The library is located in /usr/local/php/Swift and it will kept up to date with new releases.
- require_once "Swift/lib/Swift.php";
- require_once "Swift/lib/Swift/Connection/NativeMail.php";
- $swift = new Swift(new Swift_Connection_NativeMail("[email protected]"));
- $message = new Swift_Message("My subject", "My body");
- if ($swift->send($message, "[email protected]", "[email protected]"))
- {
- echo "Message sent";
- }
- else
- {
- echo "Message failed to send";
- }
- ?>
send($message, "[email protected]", "[email protected]")) { echo "Message sent"; } else { echo "Message failed to send"; } ?>
For more information check out the Swift documentation which is pretty good.