Andriy Kravchenko
Andriy Kravchenko

Reputation: 11

Cleaning user input before sending it in mail

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.

Upvotes: 1

Views: 542

Answers (2)

Michael Irigoyen
Michael Irigoyen

Reputation: 22947

Sanitation is always key when handling user input.

Upvotes: 0

Steve Nguyen
Steve Nguyen

Reputation: 5974

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

Upvotes: 3

Related Questions