You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Go to a page > Add Module > Module Creator
For the View.ascx.cs, put in the sendmail method with ASCII encoding in the button event.
Save the module. Save the field to send email and observe the email received. Check the email's Content-Type.
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
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.
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
Mail.SendMail("from@local.me", "", "test@local.me", "", 0, "", 0, Encoding.ASCII, "body\n", "", "", "", "", "");
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
Dnn.Platform/DNN Platform/Library/Services/Mail/Mail.cs
Line 109 in 584b0f5
the encoding is set to null. We shall set the encoding with the bodyEncoding
Affected version
Affected browser
Browser independent issue
The text was updated successfully, but these errors were encountered: