Swift::send expects parameter 1 to be instance of Swift_Mess

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
sobuj
Forum Newbie
Posts: 4
Joined: Wed Oct 10, 2007 7:35 pm

Swift::send expects parameter 1 to be instance of Swift_Mess

Post by sobuj »

Notice: Swift::send expects parameter 1 to be instance of Swift_Message. in /home/user/public_html/folder/swift/Swift.php on line 368

As I see from Swift.php, the first parameter should be the message. It's there, still I am getting this error message. I am using this to send the mail

Code: Select all

$swift->send($str2[1], $recipientz,  new Swift_Address($str4[0], $str4[1].' '.$str4[2]))
It's strange, as if I try to print them out, just before calling send(), as

Code: Select all

$msg = $str2[1].' * '.$recipientz.' * '.$str4[0].' * '.$str4[1].' * '.$str4[2].'<hr />';
I see things are OK. In that case, why this weird message. I must be missing something somewhere. If I find myself the issue, I'll post it back, else, thanks for the helping hands.

Best.
sobuj
Forum Newbie
Posts: 4
Joined: Wed Oct 10, 2007 7:35 pm

Post by sobuj »

OK, solved.

I changed the send to -

Code: Select all

$swift->send($message, $recipientz,  new Swift_Address($str4[0], $str4[1].' '.$str4[2]))
Post Reply