Hello again, friends !

May be someone knows about standard way to change e-mail format from plain text to html ?

Or the only way is to hack original codes to make something like that:

mail ($email, $subject, $memo, "From: $our_email\r\nContent-Type: text/html");

Many tanks in advance !

Comments

Michael M’s picture

I am not an expert when it comes to mail, but, it seems like the client will interpret the email as html or plain text. Just like when your web browser interprets a webpage as plain text or as html. The only difference between plain text and html is that the html file has html tags.

----
http://LandCondos.com

Anatsim’s picture

All html pages transmitted by http protocol.
Each frame in this protocol has a header in field "Content-Type": with "plain/text" or "html/text" etc.

The same structure exist in e-mail header:

From: xxx
To: xxx
Subject: xxx
Date: Tue, 28 Feb 2006 15:06:10 +0100
Message-ID: <000f01c64c17$4d0b41e0$8f00a8c0@office>
Content-Type: html/text;

Of course, I could hack all sources and add necessary field.
But later it will be a problem for upgrade to new version of Drupal.

That's why i'm asking about some standard solution.

Michael M’s picture

In all of my modules, I use the user_mail function to send messages. The reason for this is that some people set up custom mail handlers, like phpmailer.

The user_mail function has a parameter for headers. You can try to send the header via that parameter. The tricky part is that there might exist other Content-Type headers in your mail messages. In that case, you have to go and change the default headers in the user.module

"MIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8; format=flowed\nContent-transfer-encoding: 8Bit\n" . $header

Change that line. Line: 373

Anatsim’s picture

Exact answer, thank you !

I think that the new line (line 396 in my case) shall be like this:

 "MIME-Version: 1.0\nContent-Type: text/html; charset=UTF-8; format=flowed\nContent-transfer-encoding: 8Bit\n" . $header