Skip to content
This repository has been archived by the owner on Dec 31, 2024. It is now read-only.

Apple Mail sends attachments as inline are are marked as alternate views #81

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions MessageBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ internal static void AddBodypart(this MailMessage message, Bodypart part, string
// (i.e. spam) mails like to omit content-types so we don't check for that here and just
// assume it's text.
if (String.IsNullOrEmpty(message.Body) &&
part.Disposition.Type != ContentDispositionType.Attachment) {
part.Type == S22.Imap.ContentType.Text) {
message.Body = encoding.GetString(bytes);
message.BodyEncoding = encoding;
message.IsBodyHtml = part.Subtype.ToLower() == "html";
Expand All @@ -370,8 +370,7 @@ internal static void AddBodypart(this MailMessage message, Bodypart part, string
// Many attachments are missing the disposition-type. If it's not defined as alternative
// and it has a name attribute, assume it is Attachment rather than an AlternateView.
if (part.Disposition.Type == ContentDispositionType.Attachment ||
(part.Disposition.Type == ContentDispositionType.Unknown &&
preferAlternative == false && hasName))
(preferAlternative == false && hasName))
message.Attachments.Add(CreateAttachment(part, bytes));
else
message.AlternateViews.Add(CreateAlternateView(part, bytes));
Expand Down