I have a plugin in WP which I am going to modify. At some point I have to send an email and I have the option to choose between wp_mail and mail. I decided for the first one, at least it seems plugged in the WordPress environment. Even if I read the documentation, I can't understand how it could protect me more than mail. But a reason has to be there.
In general, may i consider the script safe if I am sending email by using wp_mail within a plugin with the parameters to, subject, body, header, "-f info@mdomain.com" ? Are there best practices to make this function safer? My concern is that for whatever reason the WP installation could be hacked and this script used to send unsolicited emails.
Regards Fabio