leungeric.com

Digg del.icio.us Technorati StumbleUpon Twitter

HTML Mine Mail for PHP Usage Tutorial

PHP | Tutorials & Resources

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

This is a PHP class which allows you to easily send email from your PHP scripts with attachments, HTML and embedded images. If you have a PHP project needs to deal with HTML email with attachments, you’ll definitely want to take advantage of this class.

http://www.phpguru.org/static/mime.mail.html

Be aware that there are 2 different versions for PHP4 and PHP5

<?php
 
// include the class
require_once('htmlMimeMail.php');
 
// initiate an object
$mail = new htmlMimeMail();
 
// define parameters & email content
$mail->setReturnPath("eric@leungeric.com");
$mail->setFrom("Eric Leung <eric@leungeric.com>");
$mail->setSubject("This is email subject");
$mail->setHtml("This is <b>HTML</b> email content");
 
// add attachment
$attachment = $mail->getFile("file.zip");
$mail->addAttachment($attachment, , 'application/zip');
 
// send email to bob@example.com
$mail->send("array('bob@example.com')");
?>
  • Digg
  • del.icio.us
  • Technorati
  • StumbleUpon
  • Reddit
  • TwitThis
  • Sphinn
  • BlinkList
  • Furl
  • Mixx
  • NewsVine
  • Slashdot
  • Ma.gnolia
  • Facebook
  • Google
  • E-mail this story to a friend!

No Comments, Comment or Ping

Reply to “HTML Mine Mail for PHP Usage Tutorial”

Sponsors