We are sending out newsletters. The format used is html as far as i know, but on some clients accented letters don't render just there code can be seen. For example: " " or "é" etc.
Unfortunately i don't know more details yet, because my friend asked me to help him with this. What would be the proper email header for these kind of emails? I suspect the problem lies there.
Thanks for helping.
update:
I got more information now. The thing is that they are using a service provided by a third party. It's web based using TinyMCE for editing mails(unfortunately i doubt that i can get access to settings). Anyway they managed to send me a header of the mail:
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=ISO-8859-1
Shouldn't be "text/html" instead of "text/plain"? Because if it's plain then it's obvious that it's not rendering, right? Or is it possible that the email header sent is "text/html" but the mail software on the client can't handle html mails and changes it to "text/plain" ? Thanks for your help, Alex
If things work for some clients and don’t work for others, it is probable that the charset parameter in the Content-Type MIME header in the email is wrong or missing (forcing programs to guess) or some email programs do not support the character encoding used or there is a similar problem with transfer encodings.
It would be (in some sense at least) simplest to circumvent such problems by encoding all non-ASCII data using entity or character references, such as ´ for é (see e.g. a list of references for the Latin-1 Supplement). This would work on all programs that can deal with HTML format and would not depend on character or transfer encoding issues.
Related
I started learning HTML + CSS a week or two ago, and I'm facing a problem. I'm european so I need to use special characters like á, ã, ç , etc a lot. Is there any other way I can do that without using the corresponding code for each letter every time I need to use one? Like a code I can put in the beggining of the html document or something like that that would make all the special characters accepted.
Decide which encoding you want to use for your site; if you don't have any preference, use UTF-8.
Save the .html file in that encoding in your text editor. Consult the help of your specific text editor how to choose which encoding the file gets saved in.
Add <meta charset="utf-8"> to your <head> to instruct the browser to treat the page as UTF-8 encoded.
Preferably also configure your web server to output a Content-Type: text/html; charset=utf-8 HTTP header, since that takes precedence if present. Consult the manual of your web server how to do that.
Write literally any character you can input directly as is into your document and enjoy.
Further reading:
https://www.w3.org/International/tutorials/tutorial-char-enc/
Handling Unicode Front To Back In A Web App
What Every Programmer Absolutely, Positively Needs To Know About Encodings And Character Sets To Work With Text
UTF-8 all the way through
This question may sound like stupid but I tried all possible HTML entities and the subject line for the email I send is still not showing the heart on Apple devices (iPhone, iPad, etc).
It may be just the software I use for testing (MaxBulk Mailer, ExactTarget).
I also tried different charset (UTF-8, ascii, etc).
Does anybody know how to make a heart appear as a heart into the subject line of an email for Apple devices?
The subject line is part of the email headers. The email headers may only contain ASCII characters. The subject line is not being interpreted as HTML or anything else, it's plain text. You need to embed the character as Unicode character, but you cannot do this since the headers must be in ASCII. To embed any non-ASCII characters in a header, you need to use a MIME Encoded-Word.
See mb_encode_mimeheader, read its examples.
The resulting header will need to look something like this:
Subject: =?utf-8?B?4p2k?=
Which decodes to this in the mail client:
❤
With regards to your question here: you may have picked the wrong heart. Try ♥ instead of ❤. The first one should render on a BlackBerry (and Android 2.2), too, as this test shows. The latter one, however, doesn't.
I want to send an email with special characters (like cyrillic) from a swf. To make sure it will be displayed correctly in the mail client, I use
encodeURI()
It works fine in Apple Mail, but in Outlook I only see gibberish. I learned that Outlook uses iso-8859-1 for "mailto:"-mails (at least by default). So two questions arise:
is there a way to encode the mailto: string in iso-8859-1?
would this break the correct display of characters in other mail clients?
I am sure that the second question can not have a definitive answer, nevertheless I would be thankful for any advise.
EDIT: unfortunately, html email and php is not an option for me.
You are using the wrong tech my friend. Just post your email data to some php script and use php to send a html email.
I have phpmailer setup to send emails from the contact form. I have the page set to UTF-8 character encoding and specify the email encoding as UTF-8 as well within PHPMailer. This all works fine and allows me to send emails with foreign/special characters. I also store the submission in a mysql database and use htmlentities with UTF-8 encoding to convert the special characters to html entities before storing them in the db. Would it be better to use htmlentities on the email text before including it in the email i'm sending out (at least on the HTML part of it, maybe not the plain text) to ensure all characters are accessible on as many email clients as possible or will it make no difference? Additionally I am using enctype="multipart/form-data" for the form, which works fine and makes sense to me, I just wanted to make sure this was correct?
Cheers!
Dave
Most email clients will automatically understand special characters, but if you are truly interested in making it compatible with all interfaces that you should use the standard HTML entities.
You can use something like this in your header
<meta http-equiv="Content-Type" content="text/html charset=UTF-8" />
This link provides a simple and elegant solution.
It's annoying to see even the most professional sites do it wrong. Posted text turns into something that's unreadable. I don't have much information about encodings. I just want to know about the problem that's making such a basic thing so hard.
Does HTTP encoding limit some
characters?
Do users need to send info about the
charset/encoding they are using?
Assuming everything arrives to the
server as it is, is encoding used
saving that text causing the problem?
Is it something about browser
implementations?
Do we need some JavaScript tricks to
make it work?
Is there an absolute solution to this? It may have its limits but StackOverflow seems to make it work.
I suspect one needs to make sure that the whole stack handles the encoding with care:
Specify a web page font (CSS) that supports a wide range of international characters.
Specify a correct lang/charset HTML tag attributes and make sure that the Browser is using the correct encoding.
Make sure the HTTP requests are send with the appropriate charset specified in the headers.
Make sure the content of the HTTP requests is decoded properly in your web request handler
Configure your database/datastore with a internationalization-friendly encoding/Collation (such as UTF-9/UTF-16) and not one that just supports latin characters (default in some DBs).
The first few are normally handled by the browser and web framework of choice, but if you screw up the DB encoding or use a font with limited character set there will be no one to save you.