Revert "Determine eMail's Content-Type "text/html" if message has "<" and ">" at the beginning and the end."

This reverts commit 70f1fb159b.
This commit is contained in:
m-lopez-f 2016-10-26 13:32:57 +02:00
parent a913b54401
commit cd179a8a20
1 changed files with 2 additions and 14 deletions

View File

@ -1074,25 +1074,13 @@ sub pandora_execute_action ($$$$$$$$$;$) {
};
# Default content type
my $content_type;
# Check if message looks like html.
# Assume that html message starts with "<" and ends with ">".
if ($field3 =~ /^\s*<.*>\s*$/s ) {
$content_type = 'text/html;';
}
else {
$content_type = 'text/plain;';
}
my $content_type = 'text/html; charset="iso-8859-1"';
# Check if message has non-ascii chars.
# non-ascii chars should be encoded in UTF-8.
if ($field3 =~ /[^[:ascii:]]/o) {
$field3 = encode("UTF-8", $field3);
$content_type .= ' charset="UTF-8"';
}
else {
$content_type .= ' charset="iso-8859-1"';
$content_type = 'text/plain; charset="UTF-8"';
}
# Build the mail with attached content