Page 1 of 1

Swift is giving me warnings (was i naughty?)

Posted: Sat Oct 07, 2006 12:47 pm
by nickvd
I am using the latest version..

Code: Select all

Warning: preg_match() expects parameter 2 to be string, array given in Swift.php on line 1144
for reference, line 1144 is within "function detectUTF8($string_in){}"

I'm trying to send to multiple recipients, but swift is spitting out the above warning for each recipient in the $to array...

the $to array is:

Code: Select all

array(7) {
  [0]=>
  array(2) {
    [0]=>
    string(10) "Jeff Brown"
    [1]=>
    string(13) "jeff@example.com"
  }
...
...

Code: Select all

require_once('Swift.php');
   require_once('Swift/Connection/SMTP.php');
   $swift = new Swift(new Swift_Connection_SMTP($_config['app']['smtpserver']));

   foreach ($recips as $recip) $to[] = array($recip['name'],$recip['email']); // didnt work with associative indexes, possible feature suggestion *****

   $swift->send($to, $_config['register']['from'], 'Personal Message: I Was Thinking Of You!', $tpl);
   dump($swift->transactions);
   dump($swift->errors);
The Kicker is... i still received the emails perfectly on my isp email account, but so far (20 minutes since i sent them) i havent gotten the one sent to my gmail address... if you need full headers, i can email/pm them to you as i'd prefer not to post them in full on the forums...

Any ideas what's going on??

I haven't tried much to fix it as i have plenty of other work to do on this project...

<edit>
I just recieved the email on my gmail account... usually they arrive instantly, i'm now wondering why it took so long...
</edit>

Posted: Sun Oct 08, 2006 9:41 pm
by Ambush Commander
GMail can be strange like that. I've had emails that mysteriously disappear and show up years later.

Posted: Mon Oct 09, 2006 3:46 am
by Chris Corbyn
I'll have a look at this in an hour or so. Upon first sight of the code you're using it does appear to be a bug :oops:

Posted: Tue Oct 17, 2006 6:36 pm
by Chris Corbyn
2.1.17 should have fixed this ;)

Posted: Wed Oct 18, 2006 3:30 am
by JayBird
Yes, i got this bug on Tuesday...glad it is fixed. Thanks