[ic] UTF-8 data in E-mail Receipts

Davor Ocelic docelic at hcoop.net
Thu Mar 1 12:50:42 EST 2007

On Thu, Mar 01, 2007 at 12:01:04PM -0500, Bill Carr wrote:
> Anyone know how I can send UTF-8 characters in e-mail receipts? The  
> characters are showing correctly on the website but the order  
> confirmation e-mails are showing 'funky' characters.

Hey Bill,

Yes, the problem here is that:

1) Order confirmation emails (for the store owner) are sent
   using Vend::Util::send_mail()
2) Customer emails are sent using [email] tag.

First, let's look at #2:

The email tag can send UTF8, provided that $use_mime = 1 and
you have MIME::Lite module.
You either have to set use_mime manually, or when there is at
least one attachment, it is enabled automatically.

One good thing to do (which is related to the other problem),
is to replace call to send_mail() in the [email] tag code
with $msg->send; (to use MIME::Lite's internal email sending
feature). - But have in mind, for this to work, use_mime (and
consequently the MIME::Lite module and its autodetection features)
always have to be enabled.

Now about #1:

To quickly enable send_mail() to work well with UF8, just
hack it to call $Tag->email(... ) instead of performing
mail sent itself. That way, message format will be autodetected
by MIME::Lite (in [email] tag) and sent properly.

Of course, the above constitutes a quick hack which will work
well enough until I reorganize email stuff and commit to CVS
(one week?). I hope to have a "plug and play" Email.pm module,
so you will be able to get away just by copying Email.pm,
[email] tag and send_mail() function to your installation.


More information about the interchange-users mailing list