Location: PHPKode > scripts > MIME Mail and SMTP > mime-mail-and-smtp/mailexample.txt

$htmlexample = <<<EOF
<div style="font:10pt Verdana;">This is the example email</div>

$testmail = new mimemail();
$testserver = new smtpmail("shawmail");

$testmail->addrecipient("hide@address.com", "To");
$testmail->setsender("hide@address.com", "A. J. Somebody");
$testmail->setsubject("This is my example email");


// This call is unnecessary, as if it is not made, the same thing
// will be send as plain text anyways.
$testmail->setplain("This is the example email.");

$testmail->addattachment("Test.txt", "This is my example attachment");


$testserver->sendmail($testmail->headers, $testmail->message);
$testserver->closeconnection(); ?>
Return current item: MIME Mail and SMTP