[BUGFIX] problem when use latest version 3.2.1 php5
Posted: Sat May 12, 2007 10:27 pm
The php version in my server is php5. Before i use the latest version ,i use swiftmailer version 3.0.6.And the following test code works well:
I have replace the mail lib with version 3.2.1, but when run the script:
the browse show errors:
Parse error: parse error, unexpected T_ARRAY, expecting '&' or T_VARIABLE in /var/www/html/eflyer/mail_lib/Swift/ArrayIterator.php on line 42
i don't know why?i have noticed the changes in version 3.2.1:Swift_RecipientList now produces iterator objects .
how can i solve that .thanks a lot.
Code: Select all
require ("mail_lib/Swift.php");
require_once "mail_lib/Swift/Connection/Sendmail.php";
// /usr/sbin/sendmail -t -i
//Try to connect using /usr/sbin/sendmail -bs
$sendmail = new Swift_Connection_Sendmail();
$sendmail->setTimeout(100); //100 seconds
$swift = new Swift($sendmail);
$swift->log->enable();//to catch failed mails;
$swift->log->setMaxSize(0);//no limit
//Create the message
$message = new Swift_Message("8 emails,test new version batch mail20070513");
//The only difference between sending a multipart message and sending a plain-text message is that we “attach”
//some MIME parts before we send the message.
//Add some "parts"
$message->attach(new Swift_Message_Part("plain message"));
$tpl='afd';
$message->attach(new Swift_Message_Part($tpl, "text/html"));
$recipients = new Swift_RecipientList();
$recipients->addTo("111@gmail.com");
$recipients->addTo("222@sohu.com");
$recipients->addTo("333@yahoo.com");
$recipients->addTo("special@gmail.com");
$recipients->addTo("aaabcdefghi@gmail.com");
$recipients->addTo("hijklmnpqmc@gmail.com");
//NOTE that Cc and Bcc recipients are IGNORED in a batch send
$num_sent=$swift->batchSend($message, $recipients, new Swift_Address("support@my.com", "myname"));Code: Select all
require ("mail_lib/Swift.php");Parse error: parse error, unexpected T_ARRAY, expecting '&' or T_VARIABLE in /var/www/html/eflyer/mail_lib/Swift/ArrayIterator.php on line 42
i don't know why?i have noticed the changes in version 3.2.1:Swift_RecipientList now produces iterator objects .
how can i solve that .thanks a lot.