Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Anatsim on
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
I am not an expert when it
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
yes
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.
In all of my modules, I use
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
Change that line. Line: 373
Super !
Exact answer, thank you !
I think that the new line (line 396 in my case) shall be like this: