PHP Classes

File: mailexample.txt

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Devin Doucette  >  MIME Mail and SMTP  >  mailexample.txt  >  Download  
File: mailexample.txt
Role: Example script
Content type: text/plain
Description: Simple example of the script
Class: MIME Mail and SMTP
Send HTML or plain text emails with attachments
Author: By
Last change:
Date: 11 years ago
Size: 921 bytes


Class file image Download

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

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

$testmail->addrecipient("", "To");
$testmail->setsender("", "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(); ?>