Location: PHPKode > projects > EXtensible Production Suite (XPS) > xpsdev/helpers/xpm3/DOCUMENTATION/mime/compose.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
body, pre {
	font-family: Verdana;
	font-size: 10pt;
<body bgcolor="#f1f3f5" topmargin="10" leftmargin="14">

XPM3_MIME :: <i>array</i> <b>compose</b> ( [ <i>mixed</i> text [, <i>mixed</i> html [, <i>mixed</i> attachment [, <i>mixed</i> unique ]]]] )
Returns an array with two values "addheader" and "body".

addheader - add this value in mail header.
body - mail body value.

Default values are:
<i>mixed</i> text: <i>boolean</i> false
<i>mixed</i> html: <i>boolean</i> false
<i>mixed</i> attachment: <i>boolean</i> false
<i>mixed</i> unique: NULL

<table border="0" bgcolor="white">
$text = array('header'  => 'Content-Type: text/plain'."\r\n".
                           'Content-Disposition: inline', 
              'content' => 'Text message');

$html = array('header'  => 'Content-Type: text/html'."\r\n".
                           'Content-Disposition: inline', 
              'content' => 'HTML message');

$attach[] = array('disposition' => 'attachment', 
                  'header'      => 'Content-Type: text/plain'."\r\n".
                                   'Content-Disposition: attachment', 
                  'content'     => 'Text file for attachment');

$result = XPM3_MIME::compose($text, $html, $attach);

// print result

/* will print:
    [addheader] => MIME-Version: 1.0
Content-Type: multipart/mixed;
    [body] => This is a message in MIME Format. If you see this, your mail reader does not support this format.

Content-Type: multipart/alternative;

Content-Type: text/plain
Content-Disposition: inline

Text message
Content-Type: text/html
Content-Disposition: inline

HTML message
Content-Type: text/plain
Content-Disposition: attachment

Text file for attachment

<hr color="white">

[ <a style="color: blue; text-decoration: none" href="mailto:hide@address.com?subject=Comment XPM3_MIME compose">Comments</a> ]

Last update: Tuesday, January 16, 2007


Return current item: EXtensible Production Suite (XPS)