It's shown in the swift documentation:
http://swiftmailer.org/docs/recipients

Use an array with the e-mail as the key and the name as the value:

array('some...@test.com' => 'Some One')

On Nov 26, 9:01 pm, Paul Witschger <tigerseyet...@gmail.com> wrote:
> I'm new to symfony, so I apologize now if this has already been
> answered, or is a stupid question.
>
> I'm trying to setup one of my form submissions to send an email whenever
> it is submitted (Contact Form).
>
> I've read the What's New section of 1.3 and it shows that you can do:
>
> $this->getMailer()->composeAndSend('f...@example.com', '....@example.com', 
> 'Subject', 'Body');
>
> or
>
> $message = $this->getMailer()->
>
> compose('f...@example.com', '....@example.com', 'Subject', 'Body')->
>
> attach(Swift_Attachment::fromPath('/path/to/a/file.zip'))
>
> ;
>
> $this->getMailer()->send($message);
>
> I don't have a problem with either one of those, but I could have sworn
> that you used to be able to address your To's and From's in the format of:
> $to = 'Put name here<em...@domain.tld>';
>
> I tried doing this, and I'm getting an error:
> Address in mailbox given [Name <em...@domain.tld>] does not comply with
> RFC 2822, 3.6.2.
> *(I've changed the name and email parts)
>
> Is this no longer allowed?
>
> Thanks

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@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