|
|||||||
| Optional email's FROM name encoding | ||||
|---|---|---|---|---|
| not working | ||||
Category Unknown |
Affected Version 1.6 Stable |
Priority Unknown |
||
Status Unconfirmed |
Fixed Version (none) |
|||
Submitted 05-16-2010 |
||||
|
||||
|
|
|
|
|
|
Optional email's FROM name encoding
not working
Hello all,
I have noticed that when i use croatian characters (like š č ć etc.) in "Optional email's FROM name" field on admin edit email settings page, e-mail could not be sent. Regards, Carlo |
|
|
||
|
||
|
Hi!
Same happens here with portuguese characters (like ç ã). Error message: Quote:
|
|
|
||
|
||
|
I think I found a way to handle with Optional email's FROM name encoding.
The problem is the From header is not encoded correctly, it should encode only the name part "xxx", not the address part <yyy@aaa.bbb.ccc> There is my code updated in class.email.php: In send method, original: Code:
$fromname=$this->getName();
$from =sprintf('"%s"<%s>',($fromname?$fromname:$this->getEmail()),$this->getEmail());
$headers = array ('From' => $from
'To' => $to,
'Subject' => $subject,
'Date'=>date('D, d M Y H:i:s O'),
'Message-ID' =>'<'.Misc::randCode(6).''.time().'-'.$this->getEmail().'>',
'X-Mailer' =>'osTicket v 1.6',
'Content-Type' => 'text/html; charset="UTF-8"'
);
Code:
$fromname=$this->getName();
// Patched by YHKao, don't add e-mail address here
if (!$fromname) $fromname=$this->getEmail();
$headers = array ('From' => $fromname,
'To' => $to,
'Subject' => $subject,
'Date'=>date('D, d M Y H:i:s O'),
'Message-ID' =>'<'.Misc::randCode(6).''.time().'-'.$this->getEmail().'>',
'X-Mailer' =>'osTicket v 1.6',
'Content-Type' => 'text/html; charset="UTF-8"'
);
Code:
//encode the headers.
$headers = $mime->headers($headers);
// Patched by YHKao, add e-mail address in from after encoding
$from =sprintf('"%s"<%s>',$headers['From'],$this->getEmail());
$headers['From'] = $from;
|
![]() |
| Issue Tools |
|---|
Subscribe to this issue |