Does anyone know how to build MIME Headers to construct a NESTED MULTIPART email?
I'm using the function and example posted @
http://www.php.net/manual/en/function.imap-mail-compose.php
This builds a MultiPart e-mail, but i want nested-multipart in order to "mimic" the structure yahoo creates (i thought this would be an easy way to 'ensure' may e-mails would be 'readable')
When i use
print_r
on
imap_fetchstructure
to get the structure of an email sent from yahoo.com with two attachments i get this:
stdClass Object
(
[type] => 1
[encoding] => 0
[ifsubtype] => 1
[subtype] => MIXED
[ifdescription] => 0
[ifid] => 0
[ifdisposition] => 0
[ifdparameters] => 0
[ifparameters] => 1
[parameters] => Array
(
[0] => stdClass Object
(
[attribute] => BOUNDARY
[value] => (not important)
)
)
[parts] => Array
(
[0] => stdClass Object
(
[type] => 1
[encoding] => 0
[ifsubtype] => 1
[subtype] => ALTERNATIVE
[ifdescription] => 0
[ifid] => 0
[ifdisposition] => 0
[ifdparameters] => 0
[ifparameters] => 1
[parameters] => Array
(
[0] => stdClass Object
(
[attribute] => BOUNDARY
[value] => (not important)
)
)
[parts] => Array
(
[0] => stdClass Object
(
[type] => 0
[encoding] => 4
[ifsubtype] => 1
[subtype] => PLAIN
[ifdescription] => 0
[ifid] => 0
[lines] => 1
[bytes] => 16
[ifdisposition] => 0
[ifdparameters] => 0
[ifparameters] => 1
[parameters] => Array
(
[0] => stdClass Object
(
[attribute] => CHARSET
[value] => iso-8859-1
)
)
)
[1] => stdClass Object
(
[type] => 0
[encoding] => 4
[ifsubtype] => 1
[subtype] => HTML
[ifdescription] => 0
[ifid] => 0
[lines] => 10
[bytes] => 364
[ifdisposition] => 0
[ifdparameters] => 0
[ifparameters] => 1
[parameters] => Array
(
[0] => stdClass Object
(
[attribute] => CHARSET
[value] => iso-8859-1
)
)
)
)
)
[1] => stdClass Object
(
[type] => 0
[encoding] => 3
[ifsubtype] => 1
[subtype] => X-VCARD
[ifdescription] => 0
[ifid] => 0
[lines] => 16
[bytes] => 1176
[ifdisposition] => 1
[disposition] => ATTACHMENT
[ifdparameters] => 1
[dparameters] => Array
(
[0] => stdClass Object
(
[attribute] => FILENAME
[value] => file.vcf
)
)
[ifparameters] => 1
[parameters] => Array
(
[0] => stdClass Object
(
[attribute] => NAME
[value] => file.vcf
)
)
)
[2] => stdClass Object
(
[type] => 0
[encoding] => 4
[ifsubtype] => 1
[subtype] => PLAIN
[ifdescription] => 0
[ifid] => 0
[lines] => 4
[bytes] => 106
[ifdisposition] => 1
[disposition] => ATTACHMENT
[ifdparameters] => 1
[dparameters] => Array
(
[0] => stdClass Object
(
[attribute] => FILENAME
[value] => file.txt
)
)
[ifparameters] => 1
[parameters] => Array
(
[0] => stdClass Object
(
[attribute] => NAME
[value] => file.txt
)
)
)
)
)
Where part "1" would be the main message, this turns out to be a multipart message itself, having part "1" [fullpath: "1.1"] with the Plain text message and part "2" [fullpath: "1.2"] with the HTML formated message, and then the attachments as parts "2", "3", etc.
HOW DO I BUILD THIS?