Hi Anthony,

I found it a lot easier just to use Swift as a vendor package.

Place it in your vendor folder, call your $this->render inside an
output buffer, and pass this to Swift.

It's not ideal, but I found it a lot easier to use than the components
floating around.

<?php
// Load in the components
vendor('Swift');
vendor('Swift/Connection/SMTP');

// Instantiate swift
$connection = new Swift_Connection_SMTP();
$swift = new Swift($connection);

// Grab the email contents
ob_start();
$this->set('event', $event);
$this->render('emails/studenteventinfo', 'email');
$message = ob_get_contents();
ob_end_clean();
                                        
// Send the email
$swift->send($studentemails, $from, $subject, $message);

// Show any errors
if ($swift->hasFailed()) {
        $this->set('errors', $swift->getErrors());
}
?>

On 06/04/07, Anthony <[EMAIL PROTECTED]> wrote:
>
> Hi, I'm using the SwiftMailer Component for CakePHP found here:
> http://bakery.cakephp.org/articles/view/193
>
> However, the newest version of SwiftMailer is 3, while the component
> is designed for 2 and no longer works "out of the box". Is there a
> version out there for version 3? Or does anybody know where I can find
> an old version 2 download of SwiftMailer?
>
> Thanks,
>
> Anthony
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to