On 6/3/11 10:58 PM, Roger Webb wrote:
I went through this *exact* issue and found an answer on the list.

You *MUST* retrieve the "mailer" before creating a new Swift_Message

$mailer = $this->get('mailer');

$message = \Swift_Message::newInstance()->...

Correct. This will not be needed anymore as of beta4.

Fabien

Roger

On Jun 3, 9:27 am, Kevin<kevinb...@gmail.com>  wrote:
I was also having this issue, updating to sf2 master cleared it up for
me.

On Jun 2, 10:35 am, keymaster<ad...@optionosophy.com>  wrote:







Getting the identical error, also on Sf2 Beta3.

*Fatal error*: Call to a member function clearAll() on a non-object in 
*C:\Program
Files
(x86)\Zend\Apache2\htdocs\Symfony\vendor\swiftmailer\lib\classes\Swift\Mime\SimpleMimeEntity.php
* on line *822

Here is the code:
*
$message = \Swift_Message::newInstance()->setSubject( 'Contact Email' )
                     ->setFrom( 's...@example.com' )
                     ->setTo( 'recipi...@example.com' )
                     ->setBody( 'Hi There' );
$this->get( 'mailer' )->send( $message );


--
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to