-
-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Access to text/plain or text/html body part? #73
Comments
zend-mail uses zend-mime to address multi-part emails. One key aspect of multi-part emails is that even with multipart/alternative, you can have more than one part using the same type. The impact this has is that
Thoughts? Originally posted by @weierophinney at zendframework/zend-mail#20 (comment) |
I agree the API of Zend\Mail is not very friendly. It's too technical Sometime Ago I had to write this project for extract the files attached in a message https://bitbucket.org/startupbootstrap/email-attachments/ Originally posted by @Maks3w at zendframework/zend-mail#20 (comment) |
I get why the \Zend\Mime API is following MIME "flexibility" of content and the impact it has on the \Zend\Mail API. @weierophinney said:
According to RFC 1521 - 7.2.3 The Multipart/alternative subtype
What I would humbly suggest (this is what I ended coding): adding a getter Originally posted by @C-Duv at zendframework/zend-mail#20 (comment) |
You could of course implement these methods, but have them return an array of body parts. That would allow for easy access, yet transparently work if there's a multitude of parts with the same content type. Originally posted by @Freeaqingme at zendframework/zend-mail#20 (comment) |
I like @Freeaqingme 's idea, but I think it should be an other method, sg. like Originally posted by @djozsef at zendframework/zend-mail#20 (comment) |
Would be nice to have an "easy" way of accessing the human-text-body part like it was possible with ZF1's
Zend_Mail
(usinggetBodyText()
,getBodyHtml()
).With current implementation of
Zend\Mail\Message
, theses human bodies are anonymous parts of the body (aZend\Mime\Message
). Once added there is no easy way of fetching the HTML body for instance.When building an e-mail it can be useful to alter the already-set body.
My workaround is to loop on each
Zend\Mime\Part
and find the one(s) having "text/html" type (or "text/plain" when looking for plain text body).Originally posted by @C-Duv at zendframework/zend-mail#20
The text was updated successfully, but these errors were encountered: