imap_mail_compose
Create a MIME message based on the given envelope and bodies sections.
Parameters
- envelope
-
An associative array of header fields. Valid keys are: "remail", "return_path", "date", "from", "reply_to", "in_reply_to", "subject", "to", "cc", "bcc" and "message_id", which set the respective message headers to the given string. To set additional headers, the key "custom_headers" is supported, which expects an array of those headers, e.g.
["User-Agent: My Mail Client"]
. - bodies
-
An indexed array of bodies. The first body is the main body of the message; only if it has a type of TYPEMULTIPART, further bodies are processed; these bodies constitute the bodies of the parts.
Body Array Structure
Key Type Description type int The MIME type. One of TYPETEXT (default), TYPEMULTIPART, TYPEMESSAGE, TYPEAPPLICATION, TYPEAUDIO, TYPEIMAGE, TYPEMODEL or TYPEOTHER. encoding int The Content-Transfer-Encoding. One of ENC7BIT (default), ENC8BIT, ENCBINARY, ENCBASE64, ENCQUOTEDPRINTABLE or ENCOTHER. charset string The charset parameter of the MIME type. type.parameters array An associative array of Content-Type parameter names and their values. subtype string The MIME subtype, e.g. 'jpeg' for TYPEIMAGE. id string The Content-ID. description string The Content-Description. disposition.type string The Content-Disposition, e.g. 'attachment'. disposition array An associative array of Content-Disposition parameter names and values. contents.data string The payload. lines int The size of the payload in lines. bytes int The size of the payload in bytes. md5 string The MD5 checksum of the payload.
Return Values
Returns the MIME message as string, or false on failure.