Sending Japanese Characters Using MIME::Lite

|
Took me a while to figure this one out, but it turns out to be very simple: just make sure you have charset=utf-8 set in the Type argument you pass to your new $msg object and Japanese characters appear fine in the received email.

For example, a simple plain text message:

        $msg = MIME::Lite->new(
From => $from,
To => $to,
Reply-to => $from,
Subject => $subject,
Type => 'text/plain; charset=utf-8',
Data => $textmessage,
);
Making sure you have the charset defined appears to solve the problem (and you can do that on HTML and multpart messages). If you are sending HTML, make sure the meta http-equiv="content-type" tag in the document head is also set to UTF-8 as well to stop email clients from gettingconfused by which content type to use.

About this Entry

This page contains a single entry by Robbie Bow published on August 31, 2006 12:54 PM.

Fasthosts Exchange Hosting Public Folders: A Bit Too Public was the previous entry in this blog.

Windows Live Mail Beta Not So Clever is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.21-en