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

DotNetNuke.Services.Mail::sendMail doesn't use bodyEncoding for alternative view in multipart message #2899

Closed
13 tasks done
tingung opened this issue Jul 19, 2019 · 1 comment · Fixed by #2900 or #4805
Closed
13 tasks done

Comments

@tingung
Copy link
Contributor

tingung commented Jul 19, 2019

Description of bug

DotNetNuke.Services.Mail::sendMail doesn't use bodyEncoding for alternative view in multipart message. Emails are sent as ASCII but whenever a special character such as \n or \r is included the content type becomes UTF-8.

Steps to reproduce

List the steps to reproduce the behavior:
Create a Simple Email module

  1. Go to a page > Add Module > Module Creator
  2. For the View.ascx.cs, put in the sendmail method with ASCII encoding in the button event.
  3. Mail.SendMail("from@local.me", "", "test@local.me", "", 0, "", 0, Encoding.ASCII, "body\n", "", "", "", "", "");
  4. Save the module. Save the field to send email and observe the email received. Check the email's Content-Type.
  5. Change the the "body\n" to "body". Save the module. Save the field to send email and observe the email received. Check the email's Content-Type.

Current result

Email with body - "body\n" Content-Type received is text/plain; charset=utf-8
Email with body - "body" Content-Type received is text/plain; charset=us-ascii

Expected result

Email's Content-Type charset should always consistent with encoding. If encoding is set to Encoding.ASCII, then charset should always ascii in
regardless the body content

Screenshots

https://www.loom.com/share/b9ebd96afcbf4070be17c063e7326752 - video recording

Error log

Nope

Additional context

var PlainView = AlternateView.CreateAlternateViewFromString(ConvertToText(body), null, "text/plain");
- the problem is
the encoding is set to null. We shall set the encoding with the bodyEncoding

Affected version

  • 9.3.2
  • 9.3.1
  • 9.2.2
  • 9.2.1
  • 9.2
  • 9.1.1
  • 9.1
  • 9.0

Affected browser

Browser independent issue

  • Chrome
  • Firefox
  • Safari
  • Internet Explorer
  • Edge
@mitchelsellers
Copy link
Contributor

Due to branching changes, this change needs to be re-evaluated to see if it is needed for the 10.x release. If so, the changes from PR #2900 will need to be replayed against the new 10.x branch.

@mitchelsellers mitchelsellers modified the milestone: 10.0.0 Aug 31, 2021
bdukes added a commit to bdukes/Dnn.Platform that referenced this issue Aug 31, 2021
This functionality was inexplicably removed in b3e066f dnnsoftware#4187

Includes fixes originally from dnnsoftware#2900 (1b44e1d)
Fixes dnnsoftware#2899
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants