2
How do I break lines in an email that will be sent via PHP
?
If I use
<br/>
It only works that the email arrives in the spam box.
Part of PHP code:
if(count($errors) == 0){
$user = get_userdata( $status );
$user->set_role('commentator_commenter');
$from = get_option('admin_email');
$headers = __( 'De', 'commentator' ).' '.$from . "</br>";
$subject = __( 'Registrado com sucesso', 'commentator' );
$msg = __( 'Você foi registrado com sucesso!<br/>', 'commentator' ).__( 'Seus dados:<br/>', 'commentator' ).__( 'Usuário:', 'commentator' ).$username.__( '<br/>Senha:', 'commentator' ).$password;
add_filter( 'wp_mail_content_type', 'set_html_content_type' );
wp_mail( $email, $subject, $msg, $headers );
remove_filter( 'wp_mail_content_type', 'set_html_content_type' );
$arr = array(
'message' => __( 'Registro com sucesso, verifique em seu e-mail a sua senha', 'commentator' )
);
}
It’s not because of
<br>
which is in the box of spam. The spacing depends on thecontent-type
that you are using to send the email.– Jorge B.
Hello @Jorgeb. I noticed this, I saw that the problem is in the characters that are accented, can not use
á, ã, õ, é, etc...
In case I have to changeset_html_content_type
forset_text_content_type
?– Alexandre Lopes
or use the special characters of HTML.
– Jorge B.
I use
Content-Type: text/plain; charset=utf-8
so I don’t have those problems. This might help you: http://wordpress.org/support/topic/wp_mail_content_type– Jorge B.
How could I implement plain text in the above code?
– Alexandre Lopes
Turn your comment into a reply :P
– Alexandre Lopes