org', 'Example');
$replies = array($reply0, $reply1);
$mailer->addReplyTo($replies);
We can add recipients in three ways:
As a normal recipient: Using addRecipient()
As a BCC (Blind Carbon Copy) recipient: Using addBCC()
As a CC (Carbon Copy) recipient: Using addCC()
Unlike the sender and reply-to address we cannot define the recipient email address
name. We either provide an email string or an array of email strings:
$mailer->addRecipient('foo@example.org');
$recipients = array('bar@example.org', ' baz@example.org ');
$mailer->addRecipient($recipients);
Out next task is to set the subject line and the body text of the email. We do this
using the setSubject() and setBody() methods:
$mailer->setSubject('Some Email');
$mailer->setBody('Lorem ipsum dolor sit amet.');
??? ??? ???
APIs and Web Services
[ 296 ]
By default email body content is always plain text. We can modify the body to support
HTML using the IsHTML() method; this sets the body MIME type to text/html:
$mailer->IsHTML(true);
Our final task is to send the email.
Pages:
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406