Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once 'lib/swift_required.php';
- // Create the Transport
- $transport = Swift_SmtpTransport::newInstance('mail.XXX.com', 25)
- ->setUsername('[email protected]')
- ->setPassword('my pass')
- ;
- /*
- You could alternatively use a different transport such as Sendmail or Mail:
- // Sendmail
- $transport = Swift_SendmailTransport::newInstance('/usr/sbin/sendmail -bs');
- // Mail
- $transport = Swift_MailTransport::newInstance();
- */
- // Create the Mailer using your created Transport
- $mailer = Swift_Mailer::newInstance($transport);
- // Create a message
- $message = Swift_Message::newInstance()
- ->setSubject(': We have a interesting offer for you!')
- ->setFrom(array('[email protected]' => 'John Doe'))
- ->setTo(array('[email protected]', '[email protected]' => 'A name'))
- ->setBody('Here iseessa the message itself')
- ->setPriority(1);
- // Send the message
- $result = $mailer->send($message);
- echo $result;
- echo $message->getHeaders();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment