Ad Widget

Collapse

PATCH: Add charset info to the email header.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pilson66
    Junior Member
    • Feb 2008
    • 10

    #1

    PATCH: Add charset info to the email header.

    Adding to the email header line:

    Content-Type: text/plain; charset="UTF-8"

    Allows to the mail-cilent to define the letter encoding automaticly.
    It provides an ability of reading of the text by the language another from the englisn.

    PATCH:
    Code:
    --- src/libs/zbxemail/email.c   2008-07-17 12:28:32.000000000 +0300 
    +++ src/libs/zbxemail/email.c   2008-07-17 12:28:32.000000000 +0300 
    @@ -230,7 +230,7 @@ 
            time(&email_time); 
            local_time = localtime(&email_time); 
            strftime( str_time, MAX_STRING_LEN, "%a, %d %b %Y %H:%M:%S %z", local_time ); 
    - cp = zbx_dsprintf(cp,"From:<%s>\r\nTo:<%s>\r\nDate: %s\r\nSubject: %s\r\n\r\n%s",smtp_email,mailto,str_time,mailsubject, mailbody); 
    + cp = zbx_dsprintf(cp,"From:<%s>\r\nTo:<%s>\r\nDate: %s\r\nSubject: %s\r\nContent-Type: text/plain; charset=\"UTF-8\"\r\n\r\n%s",smtp_email,mailto,str_time,mailsubject, mailbody); 
            e=write(s.socket,cp,strlen(cp)); 
            zbx_free(cp); 
            zbx_free(mailsubject);
    Attached Files
  • Sasha
    Zabbix developer
    • Sep 2007
    • 60

    #2
    Thanks!
    Your patch is integrated in version 1.5.4.
    ZABBIX Developer
    Riga, Latvia

    Comment

    Working...