Anyone having Undefined offset error with 2.1.17?

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

kigoobe
Forum Commoner
Posts: 38
Joined: Mon Jul 10, 2006 3:26 am

Post by kigoobe »

well, I was really stupid here, I was using a comma instead of the <> ... have changed that, and it's working ... :) But what do you mean by checking the send()?

I am having now

Code: Select all

$mailer->send(
        $recipients,
        $sender,
        $objetcordo,
        $themessage
    );
   	$mailer->close();
Should I try something like

Code: Select all

if ($mailer -> send()) { print $confirmation; } else { print $error; }
And if yes, where should I use that, before or after the $mailer -> close();

Thanks again.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

kigoobe wrote:Should I try something like

Code: Select all

if ($mailer -> send()) { print $confirmation; } else { print $error; }
And if yes, where should I use that, before or after the $mailer -> close();
Precisely ;)

Do that before calling close() otherwise you won't have a connection to send through. close() says "QUIT" to the server and then ends communication; you should only do that once you've finished with Swift :)
kigoobe
Forum Commoner
Posts: 38
Joined: Mon Jul 10, 2006 3:26 am

Post by kigoobe »

thanks again ... i have added that ... so now my SwiftMailer is working perfectly ...

thanks a million times ... :)
Post Reply