Пример #1
0
 */
$mail->setText('Sample text');
/**
 * Set the HTML of the email. Any embedded images will be automatically found as long as you have added them
 * using addEmbeddedImage() as below.
 */
$mail->setHTML('<b>Sample HTML</b> <img src="background.gif">');
/**
 * Set the delivery receipt of the email. This should be an email address that the receipt should be sent to.
 * You are NOT guaranteed to receive this receipt - it is dependent on the receiver.
 */
$mail->setReceipt('*****@*****.**');
/**
 * Add an embedded image. The path is the file path to the image.
 */
$mail->addEmbeddedImage(new fileEmbeddedImage('background.gif'));
/**
 * Add an attachment to the email.
 */
$mail->addAttachment(new fileAttachment('example.zip'));
/**
 * Send the email. Pass the method an array of recipients.
 */
$address = '*****@*****.**';
$result = $mail->send(array($address));
?>

Email has been sent to <?php 
echo $address;
?>
. Result: <?php