Set type and boundary in multipart/alternative example#254
Merged
Slamdunk merged 2 commits intolaminas:2.26.xfrom Nov 17, 2023
Merged
Set type and boundary in multipart/alternative example#254Slamdunk merged 2 commits intolaminas:2.26.xfrom
Slamdunk merged 2 commits intolaminas:2.26.xfrom
Conversation
Signed-off-by: matt <matt@claritum.com>
Slamdunk
requested changes
Nov 17, 2023
Contributor
Slamdunk
left a comment
There was a problem hiding this comment.
You are right indeed. Please remove the typo line and we can release this 💪
| $content = new MimeMessage(); | ||
| // This order is important for email clients to properly display the correct version of the content | ||
| $content->setParts([$text, $html]); | ||
| $content->setType(Mime:: |
Contributor
There was a problem hiding this comment.
A typo I guess, removal needed
Contributor
Author
There was a problem hiding this comment.
Gah. Was working late 😉
Slamdunk
approved these changes
Nov 17, 2023
kynx
pushed a commit
to kynx/SlmMail
that referenced
this pull request
Nov 17, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The current example for creating multipart/alternative emails with attachments does not set the type on the
multipart/alternativepart correctly and - I think but do not know for sure - set the boundary properly.The
$message->toString()from current example:Note the
Content-Type: application/octet-stream- this should beContent-Type: multipart/alternative.The correct output should be something like:
I happened on this while investigating Webador/SlmMail#157. The application I'm migrating to
slm/mailsets the type and boundary as in this PR, and has been sending emails over SMTP successfully for yonks.I'm not 100% sure setting the boundary is necessary. I'm not a MIME expert, but it looks suspicious to me that the first example above has the same boundary for the message as the
multipart/alternativepart. Someone made the effort in the application I'm working on to explicitly set it - I suspect it was for a reason 😁 Hopefully someone here will know for sure.