Skip to content
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

Fix MailMessage to MimeMessage conversion #2590

Merged
merged 6 commits into from Nov 14, 2017
Merged

Conversation

ryancyq
Copy link
Contributor

@ryancyq ryancyq commented Oct 12, 2017

Hi @hikalkan , as seen in #2442, I referred to the conversion method CreateFromMailMessage() and modified the EmailExtensions.cs in Abp.MailKit package.

The current release of MimeKit 1.18.1 only supports up to Net Standard 1.3. and i think that the support for Net Standard 2.0 won't be coming so soon.

if (contentType.MediaType.Equals("text", StringComparison.OrdinalIgnoreCase))
{
// Original: part = new TextPart(contentType);
// Due to consturctor of TextPart(ContentType contentType) being internal, mimic the instantiation by using MimePart(ContentType contentType)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • constructor*
  • Break line after comma

/// </summary>
/// <returns>The equivalent <see cref="MailboxAddress"/>.</returns>
/// <param name="address">The mail address.</param>
static MailboxAddress ToMailboxAddress(this MailAddress address)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excess indentation (same for ToInternetAddressList)


return message;
}

static MimePart GetMimePart(AttachmentBase item)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make default private access modifier obvious (same for ToMailboxAddress and ToInternetAddressList)

@ryancyq
Copy link
Contributor Author

ryancyq commented Oct 12, 2017

@acjh renamed the file since it has incorrect spelling.

/// </summary>
/// <returns>The equivalent <see cref="MailboxAddress"/>.</returns>
/// <param name="address">The mail address.</param>
private static MailboxAddress ToMailboxAddress(this MailAddress address)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excess indentation (same for ToInternetAddressList)

@hikalkan hikalkan added this to the v3.2 milestone Oct 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants