|
I want to send an html mail. I tried with this: $mail = new \Zend\Mail\Message();
$html = new \Zend\Mime\Part($myHtmlBody); $html->type = "text/html"; $body = new \Zend\Mime\Message(); $body->setParts(array($html)); $mail->setEncoding('UTF-8') ->setBody($body) ->setSubject($mySubject); but it puts the mail body as an attachment. Is it a bug? --- Oscar Fanelli Fondatore Gamempire.it Email: [hidden email] Email secondaria: [hidden email]Skype: gamempire Tel: 3388696167
|
|
2012/8/13 Oscar Fanelli <[hidden email]>
There are a few bugs in Zend\Mail in conjunction with Zend\Mime. One is what you describe above. It will only work if you add an empty Zend\Mime\Part first with a type of text/plain. Then you'll have a correct html message.
Similarly I have problems with attachments as Zend\Mime\Parts which are also displayed incorrectly (described in another thread at this ML). I hope these things will be addressed soon (meanwhile I am using Swift Mailer from the Symfony project).
-- Jurian Sluiman |
|
Thanks a lot for the workaround.
I will wait for something stable.
--- Oscar Fanelli Fondatore Gamempire.it Email: [hidden email] Email secondaria: [hidden email]Skype: gamempire Tel: 3388696167
Il giorno 13/ago/2012, alle ore 14:56, Jurian Sluiman <[hidden email]> ha scritto:
|
|
A little bit off topic maybe, but: You should always send a text/plain version in addition to the html version as best practice. (If i remind correct) Am 13.08.2012 15:05 schrieb "Oscar Fanelli" <[hidden email]>: |
|
I tried to do it, but it display simultaneously the plain text and the html text
--- Oscar Fanelli Fondatore Gamempire.it Email: [hidden email] Email secondaria: [hidden email]Skype: gamempire Tel: 3388696167
Il giorno 13/ago/2012, alle ore 17:38, Martin Keckeis <[hidden email]> ha scritto:
|
|
Hi Oscar,
You need to set the message's Content-Type header to; $headers->get('content-type')->setType('multipart/alternative');
On 13 August 2012 19:46, Oscar Fanelli <[hidden email]> wrote:
OuterEdge UK - an interactive web development agency www.outeredgeuk.com Registered in England 3712531 Registered Office: 1st Floor, 48-50 North Road, LANCING, BN15 9AB |
| Powered by Nabble | Edit this page |
