mimespecialchars

Description

Prepare text strings for sending as email.

Syntax

array mimespecialchars (string $string[, bool $with_charset[, bool $hotmail_fix[, string $line_break[, string $custom_charset]]]])



Parameter $string

Expected type: String
Description: A string to convert



Parameter $with_charset

Expected type: Boolean
Description: Whether or not to send the character set information in the headers. Used when hotmail_fix is true. Default is true.



Parameter $hotmail_fix

Expected type: Boolean
Description: If true, converts higher-level ASCII characters to HTML entities to ensure messages display properly in Hotmail. Default is false.



Parameter $line_break

Expected type: String
Description: What to use for line breaks. Default is "\r\n" (carriage return and new line)



Parameter $custom_charset

Expected type: String
Description: Can be used to send the email in a character set other than the one for the language you're currently using (eg $context['charset']). Used for sending emails in languages other than the default language.



Return value

Expected type: Array
Description: Returns an array with the character set, the converted string and the transport method.


Notes

  • In case there are higher ASCII characters in the given string, this function will attempt the transport method 'quoted-printable'.
  • Otherwise the transport method '7bit' is used.
  • With hotmail_fix set all higher ASCII characters are converted to HTML entities to assure proper display of the mail.
  • Returns an array containing the character set, the converted string and the transport method.
Advertisement: