Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Email encoding

More
9 years 4 months ago #115581 by kema
Email encoding was created by kema
Hello!
When sending out the welcome email for a survey, the encoding isn't correct för scandinavian letters.
I have googled and looked through the forum but so far as I can tell it should work.

I have checked the collation in the database ( = utf8_unicode_ci). I have checked the email.php (= UTF-8).
What's funny is that when I attach a "TOKEN:Attribute" to the header of the email. The token displays valid characters but not the rest of the header.

Running the precompiled-Ubuntu 141126 from bitnami.

Any pointers or hints would be greatly appreciated.

Regards
Kenneth Martinsson
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
9 years 4 months ago #115590 by Mazi
Replied by Mazi on topic Email encoding
Which Limesurvey version do you use?

Can you reproduce the problem at our demo which always runs the latest code?

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
More
9 years 4 months ago #115599 by kema
Replied by kema on topic Email encoding
Hi!

Thanks for the fast response. I'm running 2.05 build 141126.
I tried reproducing it on the demo site, but I cant send emails due to demo-mode.

TOKENS:ATTRIBUTE_1 in the email header is ok and the entire survey is ok, it's just the welcome email, that doesn't display correct.

Another thing is that when i finished my test survey the confirmation email was encoded correctly.

/Kenneth
The topic has been locked.
More
9 years 4 months ago #115601 by kema
Replied by kema on topic Email encoding
Ooh I forgot...
When sending to my personal GMail, it looks ok, but not to my personal outlook.com or to the companys exchange server.

/Kenneth
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
9 years 4 months ago #115603 by Mazi
Replied by Mazi on topic Email encoding
Did you edit the email messages?

If so, try setting it back to the default texts.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
More
9 years 4 months ago #115638 by kema
Replied by kema on topic Email encoding
Hi Mazi!
Yes I tried that as well without luck!
Gonna give it a new try tomorrow.
/Kenneth
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
9 years 4 months ago #115648 by Mazi
Replied by Mazi on topic Email encoding
Can you forward one of these buggy emails to me (see signature below for email address)?

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The following user(s) said Thank You: kema
The topic has been locked.
More
9 years 3 months ago #115751 by kema
Replied by kema on topic Email encoding
Update on the issue.
After filing a bug, c_schmitz replyied that he couldn't reproduce the issue.
I'm still trying to find the problem and have now changed mail-server to gmail instead of exchange.
Attached is the smtp debug. So there is no difference if sending through gmail or exchange.
Could it be the receiving mail server that is causing it.
The invite looks ok in GMail but not in MS (outlook.com/Exchange)
Attachments:
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
9 years 3 months ago #115755 by Mazi
Replied by Mazi on topic Email encoding
It is most probably the receiving end which causes the trouble.

Emails can look different at different email clients or web clients.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
More
9 years 3 months ago #115758 by kema
Replied by kema on topic Email encoding
I think I just found the solution :)
Changing the following in common_helper.php:

//if ($emailcharset!='utf-8')
if ($emailcharset!='iso-8859-15')
{
// $body=mb_convert_encoding($body,$emailcharset,'utf-8');
// $subject=mb_convert_encoding($subject,$emailcharset,'utf-8');
// $sitename=mb_convert_encoding($sitename,$emailcharset,'utf-8');
$body=mb_convert_encoding($body,$emailcharset,'iso-8859-15');
$subject=mb_convert_encoding($subject,$emailcharset,'iso-8859-15');
$sitename=mb_convert_encoding($sitename,$emailcharset,'iso-8859-15');
}

I have tried that in email.php and config.php with the parameter emailcharset
And it's possible that a change in some other file is better. But this seems to work.

/Kenneth
The following user(s) said Thank You: paulorcdo
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
9 years 3 months ago #115761 by Mazi
Replied by Mazi on topic Email encoding
Does that also explain why confirmation emails are sent correctly (do thy use different code)?

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
More
9 years 3 months ago #115762 by kema
Replied by kema on topic Email encoding
Good question. I haven't gotten that far yet. But I can't find any other function in common_helper.php that points to that so I don't know!?
I will try to verify this on my "production system".

/Kenneth
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose