Hi Nate
Thanks for the response. I have read a few articles but still don’t know the answer. My hosting provider is looking into it.
It seems it is definitely connected to the character encoding but I’m unsure if a change needs making to the database or if an instruction needs adding to the website to tell the receiving email client more info about the email content.
As well as your reservations plugin I also have Contact Form 7. Contact Form 7 had the same issue but I switched the email option to html and this resolved the issue. Just a workaround I know.
As far as I can see the character set seems to be correct in wp-config.php
I will paste something I read just now below and see if you think it might be relevant? It involves adding a line into the header. Please see here:
*****
header(‘Content-Type: text/html;charset=UTF-8’);
You need to add the header “Content-Type: text/html; charset=UTF-8” (for HTML Email bodies) or “Content-Type: text/plain; charset=UTF-8” (for Plain Text Email bodies) to your mail function. Like this.
$headers = array(“Content-Type: text/html; charset=UTF-8”);
mail($to, $subject, $message, $headers)
Additionally, for email, each lines should be separated with a CRLF (\r\n) instead of merely using a linefeed (\n). A fully example end result might look more so like this:
<?php
$crlf = “\r\n”;
//Get Data
$name = strip_tags($_POST[‘name’]);
$email = strip_tags($_POST[’email’]);
$service = strip_tags($_POST[‘service’]);
$phone = strip_tags($_POST[‘phone’]);
$phoneconfirm = strip_tags($_POST[‘phoneconfirm’]);
$priority = strip_tags($_POST[‘priority’]);
$subject = strip_tags($_POST[‘subject’]);
$message = strip_tags($_POST[‘message’]);
// Parse/Format/Verify Data
$to = “[email protected]”;
$from = ‘[email protected]’;
$subject = “Via Website”;
$message = “De: $name$crlf E-Mail: $email$crlf Servi?o: $service$crlf
Telefone/Celular: $phone$crlf Ligar/Retornar: $phoneconfirm$crlf
Prioridade: $priority$crlf Assunto: $subject$crlf Mensagem:$crlf
$message”;
// Setup EMAIL headers, particularly to support UTF-8
// We set the EMAIL headers here, these will be sent out with your message
// for the receiving email client to use.
$headers = ‘From: ‘ . $from . $crlf .
‘Reply-To: ‘ . $from . $crlf .
‘Content-Type: text/plain; charset=UTF-8’ . $crlf .
‘Para: WebSite’ . $crlf .
‘X-Mailer: PHP/’ . phpversion();
// Then we pass the headers into our mail function
mail($to, $subject, $message, $headers);
?>
*****
Do you think there is anything we can add that will help the email client render the special characters correctly?
I will continue to try and find a solution. It’s frustrating as I really like the plugin but can’t use it until I fix the issue.
Best regards and thanks for your help!
-
This reply was modified 7 years, 5 months ago by
lanxalot.