Ad Widget

Collapse

Send mails with HTML code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gfalardi
    Junior Member
    • Sep 2009
    • 11

    #1

    Send mails with HTML code

    hi,

    I would like to know if it's possible that Zabbix sent a mail with HTML code in the subject.

    A subject like : "<Font Color=#ff0000> xxxxxx </font>"

    Regards
  • fjrial
    Senior Member
    • Feb 2010
    • 140

    #2
    html e-mail

    It's possible:
    I did it with a change in the file src/libs/zbxemail/email.c.

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

    Change text/plain to text/html in that line, recompile zabbix code and it's done.

    Comment

    • gospodin.horoshiy
      Senior Member
      • Sep 2008
      • 272

      #3
      Originally posted by fjrial
      It's possible:
      I did it with a change in the file src/libs/zbxemail/email.c.

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

      Change text/plain to text/html in that line, recompile zabbix code and it's done.
      easy and effective! Many thanks!
      Zbx 2.0.4 on Debian and MYSQL5 on Ubuntu Server 64bit 8.04,
      200+ Win Agents, 50+ Linux Agents, 150+ Network Devices

      Comment

      • Anth0ny
        Member
        • Nov 2009
        • 85

        #4
        I post new request to Zabbix Bug Tracker:

        Need one small but useful improvement.

        Looking for posibility of sending email messages in a "plain/html" format.

        Description: if a text email message begins with the tag <html>, this tag does not appear, but such a letter should be treated as html code. And in this message should be processed all occurrences of the html tags.


        Please, vote for this!

        Comment

        • fjrial
          Senior Member
          • Feb 2010
          • 140

          #5
          +1 voted.
          Thanks.

          Comment

          • alixen
            Senior Member
            • Apr 2006
            • 474

            #6
            Hi,

            If you don't want to patch Zabbix code, you can also use an external mailer.

            I use a shell script that uses msmtp as media type.

            This way you can easily format your mail the way you want within shell script.
            As an added bonus, msmtp can use TLS and sender authentication (useful if you want to send alerts via a Gmail account).

            Regards,
            Alixen
            http://www.alixen.fr/zabbix.html

            Comment

            • soyedotun
              Junior Member
              • Jun 2017
              • 1

              #7
              Originally posted by fjrial
              It's possible:
              I did it with a change in the file src/libs/zbxemail/email.c.

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

              Change text/plain to text/html in that line, recompile zabbix code and it's done.
              how do i get there from my root/home directory

              Comment

              Working...