ec_rfc2047_encode_header

March 26, 2020 Contributors

Name

ec_rfc2047_encode_header — encode a header to be RFC2047 compliant

Synopsis

ec_rfc2047_encode_header $raw

Description

ec_rfc2047_encode_header takes a string and encodes the string following according to RFC2047, using UTF-8 for the character encoding. It will avoid encoding the string if possible. The primary use for this action is when building up headers for use in email.

($subject) = ec_header_get "Subject";
$subject = ec_rfc2047_encode_header "Re: ${subject}";

generate_mail_raw $from $to text:
From: ${from}
To: ${to}
Subject: ${subject}

hello
.
;