00001 <?php 00019 require_once('Rmail.php'); 00020 00024 $attachment = new Rmail(); 00025 $attachment->setFrom('Bob <bob@example.com>'); 00026 $attachment->setText('This email is attached.'); 00027 $attachment->setSubject('This email is attached.'); 00028 $body = $attachment->getRFC822(array('bob@dole.com')); 00029 00033 $mail = new Rmail(); 00034 $mail->addAttachment(new StringAttachment($body, 'Attached message', 'message/rfc822', new SevenBitEncoding())); 00035 $mail->addAttachment(new FileAttachment('example.zip')); 00036 $mail->setFrom('Richard <richard@example.com>'); 00037 $mail->setSubject('Test email'); 00038 $mail->setText('Sample text'); 00039 $result = $mail->send(array('foo@goo.com')); 00040 ?> 00041 00042 Message has been sent