peterkahl/tiny-mailer

Super light-weight mailer, a wrapper for the mail() function.

v1.0 2019-10-12 07:46 UTC

README

Downloads License If this project has business value for you then don't hesitate to support me with a small donation.

Light-weight PHP mailer that uses the mail() function. Plain text only. Nothing fancy. UTF-8 capable.

Usage Example

use peterkahl\tinyMailer\tinyMailer;

$body = '很可愛的 Jane,
I am so happy to use this simple mailer.
John Roe';

$arr = array(
  'sendto-name' => 'Jane Doe',
  'sendto-mail' => 'jane.doe@destination.whatever',
  'from-name'   => 'John Roe',
  'from-mail'   => 'john.roe@origin.whatever',
  'message-txt' => $body,
  'subject'     => 'Some subject text 可以用漢字',
);

$id = tinyMailer::send($arr);

if ($id === false) {
  echo 'Failed';
}
else {
  echo 'Successfuly sent message with ID '. $id;
}