PHP swiftmailer simple setup for scripts (using smtp)
- wget http://swiftmailer.org/download_file/Swift-5.0.3.tar.gz
- mv Swift-5.0.3 swift
- vi script.php
<?php // swiftmailer require_once 'swift/lib/swift_required.php'; $transport = Swift_SmtpTransport::newInstance('mail.example.com', 25) ->setUsername('username') ->setPassword('password') ; $mailer = Swift_Mailer::newInstance($transport); $message = Swift_Message::newInstance('My subject') ->setFrom(array('foo@example.org' => 'Foo Barman')) ->setTo(array('bar@example.com')) ->setBody('Hello...') ; $result = $mailer->send($message);