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:
parent
a913b54401
commit
cd179a8a20
|
@ -1074,25 +1074,13 @@ sub pandora_execute_action ($$$$$$$$$;$) {
|
||||||
};
|
};
|
||||||
|
|
||||||
# Default content type
|
# Default content type
|
||||||
my $content_type;
|
my $content_type = 'text/html; charset="iso-8859-1"';
|
||||||
|
|
||||||
# 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;';
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check if message has non-ascii chars.
|
# Check if message has non-ascii chars.
|
||||||
# non-ascii chars should be encoded in UTF-8.
|
# non-ascii chars should be encoded in UTF-8.
|
||||||
if ($field3 =~ /[^[:ascii:]]/o) {
|
if ($field3 =~ /[^[:ascii:]]/o) {
|
||||||
$field3 = encode("UTF-8", $field3);
|
$field3 = encode("UTF-8", $field3);
|
||||||
$content_type .= ' charset="UTF-8"';
|
$content_type = 'text/plain; charset="UTF-8"';
|
||||||
}
|
|
||||||
else {
|
|
||||||
$content_type .= ' charset="iso-8859-1"';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Build the mail with attached content
|
# Build the mail with attached content
|
||||||
|
|
Loading…
Reference in New Issue