From: Alan Knowles Date: Wed, 15 Aug 2018 02:26:31 +0000 (+0800) Subject: Mailer.php X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=e4d2ef5f664f31da58aa50563141e475e462a575 Mailer.php --- diff --git a/Mailer.php b/Mailer.php index 497d3213..ff0ace84 100644 --- a/Mailer.php +++ b/Mailer.php @@ -503,8 +503,9 @@ class Pman_Core_Mailer { @$dom->loadHTML('' .$html); $body = $dom->getElementsByTagName('body'); - - $body->setAttribute('class', $cls); + if ($body->count()) { + $body->item(0)->setAttribute('class', $cls); + } return $dom->saveHTML();