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.
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.
 
    
    Yes, you should ALWAYS sanitize/clean user input to prevent code or SQL injections.
 
    
    Sanitation is always key when handling user input.
strip_tags to limit the HTML tags they're allowed to use, if any.htmlspecialchars will properly change things like < into < so they can't be evaluated as HTML.pg_escape_stringmysql_real_escape_string