Recently I done this for one of customer.. It's not so hard.. You have to add one heading to function mail() in place when You want to use html (because mails are sending in some places , and when You add this heading in global function all mails will be send in html format). This heading is: "Content-type: text/html; charset=utf-8 \r\n" and it should be added after heading which describes from who the mail it is.. After this modification You can use html tags and css styles (but only inner) in template of email..
kalanta
2008-09-05 12:31
I need more info, 'cause I'm not a good programmer- I'm working with CSS, HTML and graphic design only. Could you explain that or paste changed code?
I can't give You solution in few steps.. It's little more complicated.. and You should know html and php if You want make this modification..
aquasyl
2008-09-06 09:50
Hey Makaron. can you detail more this? I have QCv2.x, is it possible to have html mail, wtih it?
Can you say where exactly you put this code ? "Content-type: text/html; charset=utf-8 \r\n"
Do i must to put it in heading of my mail ? In sendoredertoclient.tpl for exemple ? <!-- BEGIN EMAIL_HEAD --> "Content-type: text/html; charset=utf-8 \r\n" .....here my html text ....... <!-- END EMAIL_HEAD -->
@aquasyl: The simpliest way to set it is to change global function which sends emails.. Edit file core/other.php You see function sendEmail? You have code like this:
I see that this topic is quite popular so I try to help You.. In all versions of script (in version 3.x file core/common.php; in version 2.x file core/other.php) You have function sendEmail and code:
And now in place where this function is used fe. in version 3.1 it is function which sends order to admin You can find it in file core/orders.php. This function uses function sendEmail it contains code like this:
I want to make a html message that is send to the client that looks like a invoice with a loge and with tables .... can you pls explain where can we put the html code?
Garry3005
2009-07-28 01:36
I have tried for hours but cant get html mail to work. Hve added send to client and the html mail from above post it sends the html headers but can not get the sections in the correct palce on the sent email here is code not compleate but it places the user details after the items list.
<!-- BEGIN CUSTOMER_ORDER_EMAIL_TITLE -->$lang[Order_customer_info_title]$aData[iOrder]<!-- END CUSTOMER_ORDER_EMAIL_TITLE -->
<!-- BEGIN CUSTOMER_ORDER_EMAIL_HEAD --> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Email Test</title> <style type="text/css"> <!-- body { background-color: #CCFF66; } --> </style>
Garry3005, if you have trouble with this, you will definitely have problem with constructing correct multipart HTML email. I've done this for a customer multiple times, I am very proficient in all this. I offer paid assistance, or ask opensolution.org guys to help you. If you need so, find my contact info on this forum and write me an email.
Garry3005
2009-07-29 23:56
This sends Html email to customer
First instal sendmailtocustomer plugin, Then follow steps above from Makaron to change customer email to html install paypal plugin open orders_print.tpl for editing after the line <!-- BEGIN ORDER_EMAIL_FOOT --><!-- END ORDER_EMAIL_FOOT --> remove all code and replace with code bellow
<!-- Customer Order Email HTML V0.9 --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <head> </head>
<body> <!-- BEGIN CUSTOMER_ORDER_EMAIL_TITLE --> $lang[Order_customer_info_title]$aData[iOrder] <!-- END CUSTOMER_ORDER_EMAIL_TITLE -->
Garry, this HTML email is no good. It is no multipart email, it will not work correctly in some email clients.
Garry3005
2009-07-31 00:20
Kalanta This does not change emails sent to admin only mail sent to customers
beholder Its ok to offer a paid service, then turn round and say this html is no good. I fully understand that at the moment its not multipart, and bearing in mind never having had anything to to with sending html emails. Without any help I actually managed to get it to send and display correctly in Outlook Express, Thunderbird 2 and Thunderbird 3 beta 3. At least I am willing to try and share my findings Garry
Look, Garry, I am only informing you, that your solution is low-quality. Try in Opera 9 with 'prefer HTML' off and prepare for a surprise. You should be glad that you know of this liability. Multipart HTML emails are no easy business, I know that, I was there before where you are now - and right now I am just trying to help out. My point is that you don't choose email clients of your customers, they do it for themselves. I don't need your money, I request to be paid only if the solution takes significant time. Take your shot at the multipart email template, if it proves impossible, you MAY ask me to help you out commercially.