1

I am using PHPMailer class to send mails. Some mails contain user input. Should I clean user input before inserting it to mail body? How to do this?

Tried to google for it but haven't fount anything useful.

2 Answers2

3

Yes, you should ALWAYS sanitize/clean user input to prevent code or SQL injections.

FinalForm
  • 5,648
  • 5
  • 20
  • 37
0

Sanitation is always key when handling user input.

Michael Irigoyen
  • 21,897
  • 17
  • 84
  • 130