<?php
require_once 'lib/swift_required.php';
$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, 'ssl')
->setUsername('[email protected]')
->setPassword('password')
;
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance('HomeWork')
->setFrom(array('[email protected]' => 'NAME'))
->setTo(array('[email protected]'=> 'NAME'))
->setBody('Test Message Body')
;
$mailer->send($message);
?>
It works but sender is '[email protected]'. How can I specify any other email address in order to send fake email?
reply-to
could accomplish OP's needs? – Bradytelic