Projects > MIMEMailPHP4 >
Feike Open Source

Open Source & GPL Projects

my contribution to the freedom of programing



MIMEMailPHP4 Open Source Project


+ setSubject(string)
+ setTextContent(string)
+ setHTMLContent(string)
+ setFromHeader(string)
+ setRecievers(string|array)
+ setCCRecievers(string|array)
+ setBCCRecievers(string|array)
+ sendMail(boolean)
+ setEOL(string)
+ addBinaryFileAsAttachment(...)
+ addBinaryStringAsAttachment(...)
+ setReplyTo(string)
+ getLastErrorString()
+ getLastErrorCode()

Building a MIME multipart email with php is always not simple and no fun. Therefore I wrote this class in PHP4 to encapsulate the strange syntax. I give it to you as open source and hope that you will find it usefull. It writen straight forward and fairly slim and efficient.

The software can send the following types of mail: HTML mail, HTML mail with attached pictures (multipart/mixed), HTML mail with binary attachments, HTML mail with attachments and inline (cid) images, all HTML mails with plain text alternativ representation (multipart/alternative), text-only mail, text mail with attachments. Configurable encoding.

The program is developed in eclipse using the PHP Plugin. The functions are documented in a java doc style. Thats useful because in eclipse the code-completion and hoover help will work.

A simple coding example:
 * Testprogram for MIMEMailxPHP4_V2
 * Scope: sending simple text-only mail to two recievers

// include class

// create instance
$mail = new MIMEMailxPHP4_V2();

// set text content
$mail->setTextContent("Hello World, this is my email.");
// set sender
$mail->setFromHeader("Example <exm@example.test>");
// set recievers
$mail->setRecievers(Array("", "exm2@example.test"));
// set subject
$mail->setSubject("testmail from MIMEMailxPHP4 V2");

// send mail
$rc = $mail->sendMail();

You will find more in the documentation section.
For feedback please use my weblog.
Last Update: April 2007