NOTE:
- This code is not unit tested hence not production ready, use it at your own risk. (If you can write unit test cases, let me know we can still improve this code and make it production ready)
- It has some interesting features which are still lacking in latest email libraries
- You can still use it for learning purpose
// Adding from header along with name $obj->from(array('Your name'=> [email protected])); // Adding from header just email $obj->from('[email protected]'); // In Reply to (When replying to a mail) when you know message it $obj->inReplyTo('Id-of-old-message'); // In Reply to (When replying to a mail) when you have message saved $fd = fopen('old-mail.eml', 'r'); $obj->inReplyTo($fd); // In Reply to (When replying to a mail) when you have message content $obj->inReplyTo('content of the mail'); // Will work only if message cotains proper headers // To > Just email $obj->to('[email protected]'); // To > Name and email $obj->to(array('Your name' => '[email protected]')); // To > Multiple recepient > Name and email $obj->to(array('Your name 1' => '[email protected]', 'Your name 2' => '[email protected]')); // To > Multiple recepient > email $obj->to(array('[email protected]', '[email protected]')); // Send separately to each TO-Recepient $obj->sendSeparetely(TRUE); // Do not Send separately to each TO-Recepient $obj->sendSeparetely(FALSE); // Send separately to each TO-Recepient & Regenerate message-id for each email $obj->sendSeparetely(TRUE, TRUE); // Send separately to each TO-Recepient & Keep same message-id for each email $obj->sendSeparetely(TRUE, FALSE); // Subject $obj->subject('Your subject'); // CC > Just email $obj->cc('[email protected]'); // CC > Name and email $obj->cc(array('Your name' => '[email protected]')); // CC > Multiple recepient > Name and email $obj->cc(array('Your name 1' => '[email protected]', 'Your name 2' => '[email protected]')); // CC > Multiple recepient > email $obj->cc(array('[email protected]', '[email protected]')); // BCC > Just email $obj->bcc('[email protected]'); // BCC > Name and email $obj->bcc(array('Your name' => '[email protected]')); // BCC > Multiple recepient > Name and email $obj->bcc(array('Your name 1' => '[email protected]', 'Your name 2' => '[email protected]')); // BCC > Multiple recepient > email $obj->bcc(array('[email protected]', '[email protected]')); // Reply to > Just email $obj->replyTo('[email protected]'); // Reply To > Name and email $obj->replyTo('Your name', '[email protected]');// TODO: Complete DOCUMENTATION