wp_mail send multiple emails in a loop

Function wp_mail() not suitable for use in a loop. Unfortunately, a loop iterating over and over hundreds of times could considerably slow down the script, as pointed out in the reference on the PHP_mail() function. It is worth nothing that the mail() function is not suitable for larger volumes of email in a loop. This … Read more

Remove wpautop from retrieve_password_message

Thanks to the constructive conversation with Jacob in the comments, I did some additional tests and realized that the <p> tags were in fact added by the plugin – testing in ive environment revealed that the email was plain text. The solution to the problem was to add the following snippet in my functions.php: function … Read more

Send email with Content-Type text/plain

You didn’t say how you’re sending emails, but if you’re using wp_mail, this is how you change the type to text/plain: function wp_set_mail_plaintext() { return ‘text/plain’; } add_filter( ‘wp_mail_content_type’, ‘wp_set_mail_plaintext’ );