Swift mailing problem
Posted: Sat Jan 20, 2007 9:52 am
I am using Swift-2.1.17-php4 to send emails from within a php script. The emails are sent but i don't get the "well" (from the last script line) displayed, just a blank page. What am i doing wrong, can someone please help? Here is my code:
Code: Select all
<?php
$emailblock=array();
$prenume="Do";
$name="Lla";
$emailadresse="recipient1@gmail.com";
$emailblock[]=array($prenume.' '.$name, $emailadresse);
$prenume="Dod";
$name="Lla";
$emailadresse="recipient2@yahoo.com";
$emailblock[]=array($prenume.' '.$name, $emailadresse);
$subject="Bla";
$mailtext="well";
require('Swift/Swift.php');
require('Swift/Swift/Connection/SMTP.php');
$mailer = new Swift(new Swift_Connection_SMTP('smtp.gmail.com', 465, SWIFT_TLS));
$mailer->authenticate('sender@gmail.com', 'pass');
if (!$mailer->hasFailed())
{
$mailer->send(
$emailblock,
'"FIIB" <sender@gmail.com>',
''.$subject.'',
"".$mailtext.""
);
}
else
echo "The mailer failed to send the mail. Errors: <pre>"
.print_r($mailer->errors, 1)
."</pre><br />Log: <pre>"
.print_r($mailer->transactions, 1)
."</pre>";
if ($mailer->isConnected())
{
$mailer->close();
}
echo "well";
?>