On a website if I have a form where the user can input some text and then a page which displays what the user has entered. I know to html encode the values the user has entered to prevent scripting attacks. If the form was sending emails addresses I presume I would do the same but is there any special cases for emails and will email clients run the any script injected into the email?
Share
You should definitely HTML encode before assigning posted content to the HTML body of an email. Your code should already be rejecting content such as ‘<script>’ as invalid, not just in the case of an email but in all cases.
There are no other considerations you need to worry about.