Home › Forums › Theme support › Unicode support in contact form?
This topic contains 14 replies, has 2 voices, and was last updated by 7Theme Support 8 years, 7 months ago.
-
AuthorPosts
-
Hi,
I am using the shortcode
[contact]
on a german website with the Trattoria theme. I was able to make german translations. However, when website visitors use the contact form the email does not handle all characters correctly, e. g.
“Geht Ãœbernachtung bei Ihnen?” or “Ich danke für die Rückäußerung.”
It seems as if some part does not handle unicode correctly. But which part? The contact form? The mail sending script?
Any idea on how to test and solve?
Best wishes
ThomasHi Thomas,
hm, normally it should work.
It seems as if some part does not handle unicode correctly. But which part? The contact form? The mail sending script?
I think if there is a problem then it’s the sending script. But if you can give us one day to test it and find the problem, then I’m sure we can solve it and make an update for it.
Any news on this problem? I gave you some days ;-).
While searching for a solution I came across some hints that many contact forms use WordPress methods in “inclass-phpmailer.php” in “/wp-includes”. So it may depend on whether
public $CharSet = ‘iso-8859-1’;
is set correctly. Or do you override this setting with a utf-8 charset at some other place?
Thanks in advance
Thomasof course, it must be
in “class-phpmailer.php”
Hi Thomas,
we still searching the problem. But to be honest we’ve tested it on our server and it’s working always without any problem. What email provider to you use? Gmail? I remember we had a similar problem with a client, her email provider was Telecom, this company was not able to display the characters from the php mailer.
By the way: the contact form use “php mail” function, not the WordPress mail function, so it could not be the problem.
Hi
thanks for your feedback, this helps very much.
So if the mail provider would be the problem, then the same problem should occur for any mail sent to the corresponding email address. In fact, we are sending the messages of the form to an email address at the same domain. So I have to check the mail settings of this domain.
Thanks again! I think this points to the right direction… otherwise there would be many users of your themes with the same problem.
Best wishes
ThomasHi,
I just contacted my hosting company for the domain/email server. They responded
*****************
The Emails that are sent from the contact form are not encoded with UTF-8. This is the reason that some letters (so called “Umlaute”) are not displayed correctly. The
UTF-8 encoding is used for the website, however, this must be added to wp-mail.php as well.To change the encoding to UTF-8 it is sufficient to give the value in the following way
$charset = ‘UTF-8’;
Right now, it has the value
$charset = ”;
Our mail server simply use the encoding provided by the sender of the message, in your case the encoding of the contact form. A change of the encoding by our mail server is not possible.”
*****************I think, that part of their response is nonsense. The $charset = ”; in wp-mail.php is simply a default value before the encoding is derived from the message.
However, there still remains the question where the non-UTF-8 encoding is coming from. I watched the incoming message to my mail server… and the message was not UTF-8 encoded.
… there must be some problem with the contact form and the way the message is sent …
Best wishes
ThomasHi Thomas,
the problem is that we dont use wp_mail() for sending the emails. But I think in the meantime we found the problem, we will make some tests, and if it’s working then we upload the update for the issue.
Thomas, do you know how to replace a single file in the theme with FTP? We think we fixed the issue, but due to the fact we don’t see the problem with our email provider, we cannot test it. If you want, we can send you the file (it’s only one), then you can replace it and test it if it’s working…
Yes, I know how to do that. You have my email address?
Thank you very much for your help!
I have to be careful when updating the theme at a later stage, right?
Anyway… thanks again.
Hi,
send a mail to the email from your useraccount:
in…@….ns.de
Hi,
thanks! I successfully uploaded the new version. Including the UTF-8 encoding in $header is a good idea. Before this modification we had observed that some messages were fine, others had errors. This may have been due to the device (Mac, PC, smartphone…) that the individual visitor of the website had used. Now, it seems pretty good… I tested it by sending messages from different devices to different email addresses and reading these emails with different mail clients. The problem seems to be resolved.
Two final points…
First, I was confused by the fact that the messages were displayed incorrectly (even now) when I looked into my gmx-account (IMAP) via different browsers. The mail clients, however, that download the messages from the gmx server displayed the messages correctly. No, I do not want to talk with gmx about the encoding of their webmail interface ;-). But it shows that testing such problems can be complicated.
Second, I noticed that the [contact] shortcut in the Trattoria theme sends the email to the address given in WordPress-Settings-General-Email address which is marked as “Only used for administrative purposes”. The email address given in Design-Theme options-Contact Page is simply ignored. Is this a feature or a bug?
Thanks again
ThomasNo, I do not want to talk with gmx about the encoding of their webmail interface 😉
🙂
Strange thing with the mails, but I think in this case we can do nothing…
The email address given in Design-Theme options-Contact Page is simply ignored. Is this a feature or a bug?
Are you sure? We will test it again, but it’s not a feature, the contact mail in the theme options should work…
Oh my god, you are right, the options for the mail is not working. We are uploading the update with the fix. Shall we send you the file again via mail?
Theme is updated, version 1.01 is available in your account…
-
AuthorPosts
You must be logged in to reply to this topic.