Is an email with different character encoding for it's header and body valid? The Use Case: While processing an email, should I check for the character encoding of it's header separately, or will checking that of it's body be sufficient? Can someone guide me as to how to figure this out? Thanks in advance!
Can an email header have different character encoding than the body of the email?
6.1k Views Asked by Chetan At
1
There are 1 best solutions below
Related Questions in EMAIL
- how to send email from localhost using codeigniter?
- PowerShell EWS Save as for e-mails
- I want to develop an automated email application in asp.net with c#
- Not able to send email in java using SMTP,its blocked by firewall in my office.Is there any other method by which we can send mail?
- Postfix - cannot connect to server to receive email
- PHPMailer send mail with array ( $_POST['email'] )
- Could Not Instantiate Mail Function - PHPMailer - With Attachments - Only Google Chrome
- encrypted email with entrust certificate is not opening with MS Outlook
- Disconnect Client connected to cgi application
- send a message using freemarker
- Using advanced ccs icons in email signatures
- How can I fetch emails on Android?
- Issue with email form and php script
- HTML Control Form with PHP - Errors
- javax.mail.getValidSentAddresses()
Related Questions in MIME
- Gmail API playground: Send method, converted MIME raw header not populating email fields on send
- HTML image not showing up in MIME message sent via Gmail API in VBA, Used 3D
- Identifying a pdf file and upload it to folder
- How to create MIME-atachment text/xml in Java?
- Python SMTP/MIME Message body
- Why can't insert my subject of gmail header info into a sqlite3 database?
- MIME-attach in java SOAPMessage
- Plain text emails displayed as attachment on some email clients
- Trying to send "alternative" with MIME but it also shows up in capable mail client
- TypeError: object of type 'method' has no len() | Trying to attach file to email msg
- "All Supported" in "Files of type:" combobox of QFileDialog
- SMTP dot-stuffing within MIME boundaries
- Zip sent via email is invalid on first attempt
- php bug? reading mime enc on a 1 byte file?
- android get full path to my application via share option
Related Questions in RFC822
- JS convert string to rfc822
- Can an email header have different character encoding than the body of the email?
- antispam and RFC status codes
- How to convert to / get RFC822 date in bash/linux?
- Convert RFC 822 timestamp to unixtime, timezone values not working , C/C++
- How to decorate (monkeypatch...) a Python class with methods from another class?
- What is the RFC 822 format for the email addresses?
- Convert 1982 RFC822 to ISO 8601 Date Format using Yahoo Pipes
- Elegant way to serialize a MailMessage object in .NET
- Strip e-mail addresses from a string in PHP
- Why does email need an envelope, and what does the "envelope" mean?
- What are special characters in E-Mail-Headers and when to use quotes?
- Parsing e-mail-like headers (similar to RFC822)
- Hotmail is ignoring return-path header
- How to use Java to read .mgs attachment using bodyPart.isMimeType("message/rfc822")
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Email headers should use the ASCII charset, if you want the header fields to have a different encoding you need to use the encoded word syntax: http://en.wikipedia.org/wiki/MIME#Encoded-Word
The email body can be directly encoded in different encoding only if mail servers that transfer it have 8bit mime enabled (nowadays every mail server should have it enabled, but it's not guaranteed), otherwise you need to encode the body in transfer encoding (quoted-printable or base64)
The charset can be different in each case, that is you can have every encoded word in different charset and every mail part encoded in different charset or even different transfer encoding as well.
For example you can have:
and the body encoded:
different charsets, different transfer encodings in the same email, no problem.
From experience I can tell you that such mails are very common. Even worse, you can get an email that states one charset in Content-Type header and another charset in html body meta tag:
It's up to you to guess the actual charset used. Probably it's the one in meta tag.
Assume nothing. Expect everything. Take no prisoners. This is Sparta.