Hey!
For those, who are having problems with utf-8, something to this: viewtopic.php?f=4&t=3764, here is the solution.
Well, the original fix didn't work for me - so here are the key things for those, who need the contact form to be able to hand latin extended (for my case: ā, č, ģ, ī, ķ, ļ, ņ, š, ū, ž;)
FIX IN THE KK POST UNDERNEATH MY ORIGINAL MESSAGE!
Steps
@ /couch/includes/email.php
change "iso-8859-1" -> "utf-8", this will make message work, if end-user chooses to "View All The Headers And Message
@ /couch/functions.php
define headers array - it must be clearly defined array, otherwise it won't work - this actually adds real headers to the message
add the new code just before
Long story short - you can add more headers using this method - original mail headers are:
Compare this to any e-mail message header you usually receive, and you may see some points as to why this feature could be useful to some sites, other than fixing utf-8 bugs.
Hope this helps someone.
For those, who are having problems with utf-8, something to this: viewtopic.php?f=4&t=3764, here is the solution.
Well, the original fix didn't work for me - so here are the key things for those, who need the contact form to be able to hand latin extended (for my case: ā, č, ģ, ī, ķ, ļ, ņ, š, ū, ž;)
FIX IN THE KK POST UNDERNEATH MY ORIGINAL MESSAGE!
Steps
@ /couch/includes/email.php
- Code: Select all
// Set HTML
function setHTML($charSet = 'iso-8859-1') {
if($charSet) {
$tmp1 = $this->addHeader('MIME-Version', '1.0');
$tmp2 = $this->addHeader('Content-type', 'text/html; charset=' . $charSet);
} else {
$tmp1 = $this->addHeader('MIME-Version');
$tmp2 = $this->addHeader('Content-type');
}
change "iso-8859-1" -> "utf-8", this will make message work, if end-user chooses to "View All The Headers And Message
@ /couch/functions.php
- Code: Select all
function send_mail( $from, $to, $subject, $text, $headers="" ){
// Source: http://www.anyexample.com/
if( strtolower(substr(PHP_OS, 0, 3)) === 'win' ){
$mail_sep = "\r\n";
}
else{
$mail_sep = "\n";
}
$h = '';
if( is_array($headers) ){
foreach( $headers as $k=>$v ){
$h .= $this->_rsc($k).': '.$this->_rsc($v).$mail_sep;
}
if( $h != '' ) {
$h = substr($h, 0, strlen($h) - strlen($mail_sep));
$h = $mail_sep.$h;
}
}
$from = $this->_rsc( $from );
$to = $this->_rsc( $to );
$subject = $this->_rsc( $subject );
if ( defined('K_USE_ALTERNATIVE_MTA') && K_USE_ALTERNATIVE_MTA ){
return @email( $to, $subject, $text, 'From: '.$from.$h );
}
else{
return @mail( $to, $subject, $text, 'From: '.$from.$h );
}
}
define headers array - it must be clearly defined array, otherwise it won't work - this actually adds real headers to the message
- Code: Select all
$headers = array
(
"MIME-Version" => "1.0",
"Content-Type" => "text/html; charset=UTF-8",
);
add the new code just before
- Code: Select all
$h = '';
Long story short - you can add more headers using this method - original mail headers are:
- Code: Select all
Return-path: <xxx@watorxxx.wostwator.com>
Envelope-to: rxxx@mxxx.lx
Delivery-date: Wed, xx Aug 2013 21:24:16 -0500
Received: from xxxxx by watorxxx.wostgator.com with local (Exim 4.80)
(envelope-from <xxxx@watorxxx.wostgator.com>) id xxxxxx-xxxxxx-xx for
rxxxx@mxxxx.lx; Wed, xx Aug 2013 21:24:16 -0500
To: rxxxx@mxxxx.lx;
Subject: test message
X-PHP-Script: domain.com/en/contact.php for xx.xx.148.117
From: test@domain.com
Message-ID: <xxxxxx-xxxxxx-xx@xxx@watorxxx.wostgator.com>
Date: Thu, 15 Aug 2013 05:24:16 +0300
Compare this to any e-mail message header you usually receive, and you may see some points as to why this feature could be useful to some sites, other than fixing utf-8 bugs.
Hope this helps someone.