0

I create a function to send mail (in french) for custom post, it's work but subject is encoding in html.

I do this :

$get_title = get_the_title($ID);
wp_mail("me@my.com","new article : ".$get_title,"The message is OK with é è à",$headers);

My email source is like this

X-Mailer: PHPMailer 5.2.14 (https://github.com/PHPMailer/PHPMailer)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

I get this subject « new article : it’s not ok ».

0

It's look OK with : html_entity_decode

wp_mail("me@my.com","new article : ".html_entity_decode($get_title),"The message is OK with é è à",$headers);

Not so good, another try :

wp_mail("me@my.com","new article : ".$post->post_title,"The message is OK with é è à",$headers);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.