Skip to content

Instantly share code, notes, and snippets.

@pdesterlich
Created May 20, 2009 06:07
Show Gist options
  • Save pdesterlich/114650 to your computer and use it in GitHub Desktop.
Save pdesterlich/114650 to your computer and use it in GitHub Desktop.
foreach ($aMail as $rMail) {
//Create the Transport
$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, 'tls')
->setUsername('[email protected]')
->setPassword('SoftwareService');
//Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
//Create a message
$message = Swift_Message::newInstance()
->setSubject($rMail['subj'])
->setFrom(array('[email protected]' => 'Elco Sistemi - Assistenza'))
->setTo($rMail['dest'])
->setBody($rMail['body']);
//Send the message
$result = $mailer->send($message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment