How about this:

$message = $this->getMailer()
   ->compose('[email protected]', $address, $obj, $msg);

foreach ( $fichiers as $fichier )
{
    $message->attach(Swift_Attachment::fromPath($fichier)) ;
}

$this->getMailer()->send( $message );




On Fri, Oct 22, 2010 at 5:51 AM, jimpass <[email protected]> wrote:

> Hi,
> I'd like to attach more than one file in a mail, at now i do like
> that :
>
> foreach ($fichiers as $fichier):
>        $message = $this->getMailer()
>          ->compose('[email protected]', $address, $obj, $msg)
>          ->attach(Swift_Attachment::fromPath($fichier)) ;
>        $this->getMailer()->send($message);
> endforeach;
>
> But it sends one mail for each file of course ...
>
> Thanks for your help !
>
> --
> 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 [email protected]
> To unsubscribe from this group, send email to
> [email protected]<symfony-users%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>

-- 
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to