MAIL -> boolean addto ( string address [, string name [, string charset [, string encoding ]]] )
Return TRUE if has been successfully added, FALSE if not. string address format is "localpart@domainpart.tld". Default values are: string charset: utf-8 string encoding: quoted-printable string encoding possible values are: quoted-printable or base64 Example (verification):

$m = new MAIL;

// add "To" mail address and name
$t = $m->AddTo('localpart@domainpart.tld', 'Client Name');

echo $t ? 'added' : 'error';
Example (deprecated):

$m = new MAIL;

// add "To" mail address, name, charset and encoding
$m->To[] = array(
'address'  => 'localpart@domainpart.tld', // required
'name'     => 'Client Name', // optional
'charset'  => 'utf-8', // optional
'encoding' => 'base64' // optional
);
// add another "To" mail address
$m->To[] = array('address' => 'localpart@domainpart2.tld');

See Also: MAIL->DelTo(), MAIL->AddCc(), FUNC::is_mail() [ Comments ] Last update: Monday, June 11, 2007