Beispiel #1
0
<?php

/**
 * o------------------------------------------------------------------------------o
 * | This package is licensed under the Phpguru license. A quick summary is       |
 * | that for commercial use, there is a small one-time licensing fee to pay. For |
 * | registered charities and educational institutes there is a reduced license   |
 * | fee available. You can read more  at:                                        |
 * |                                                                              |
 * |                  http://www.phpguru.org/static/license.html                  |
 * o------------------------------------------------------------------------------o
 *
 * � Copyright 2008,2009 Richard Heyes
 */
/**
 * This example includes setting a Cc: and Bcc: address
 */
use RMail\Rmail;
/**
 * Now create the email it will be attached to
 */
$mail = new Rmail();
$mail->setFrom('Richard <*****@*****.**>');
$mail->setSubject('Test email');
$mail->setCc('*****@*****.**');
$mail->setBcc('*****@*****.**');
$mail->setText('Sample text');
$result = $mail->send(array('*****@*****.**'));
?>

Message has been sent
Beispiel #2
0
 * |                  http://www.phpguru.org/static/license.html                  |
 * o------------------------------------------------------------------------------o
 *
 * � Copyright 2008,2009 Richard Heyes
 */
/**
 * This example shows you how to create an email with another email attached
 */
use RMail\Rmail;
/**
 * Create the attached email
 */
$attachment = new Rmail();
$attachment->setFrom('Bob <*****@*****.**>');
$attachment->setText('This email is attached.');
$attachment->setSubject('This email is attached.');
$body = $attachment->getRFC822(array('*****@*****.**'));
/**
 * Now create the email it will be attached to
 */
$mail = new Rmail();
$mail->addAttachment(new StringAttachment($body, 'Attached message', 'message/rfc822', new SevenBitEncoding()));
$mail->addAttachment(new FileAttachment('example.zip'));
$mail->setFrom('Richard <*****@*****.**>');
$mail->setSubject('Test email');
$mail->setText('Sample text');
$result = $mail->send($addresses = array('*****@*****.**'));
?>

Message has been sent to: <?php 
echo implode(', ', $addresses);
Beispiel #3
0
<?php

/**
 * o------------------------------------------------------------------------------o
 * | This package is licensed under the Phpguru license. A quick summary is       |
 * | that for commercial use, there is a small one-time licensing fee to pay. For |
 * | registered charities and educational institutes there is a reduced license   |
 * | fee available. You can read more  at:                                        |
 * |                                                                              |
 * |                  http://www.phpguru.org/static/license.html                  |
 * o------------------------------------------------------------------------------o
 *
 * � Copyright 2008,2009 Richard Heyes
 */
use RMail\Rmail;
$mail = new Rmail();
/**
 * Set the from address of the email
 */
$mail->setFrom('Richard <*****@*****.**>');
/**
 * Set the subject of the email
 */
$mail->setSubject('Test email');
/**
 * Set high priority for the email. This can also be:
 * high/normal/low/1/3/5
 */
$mail->setPriority('high');
/**
 * Set the text of the Email