Skip to content

Instantly share code, notes, and snippets.

@danielpotthast
Created March 19, 2019 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielpotthast/e368e100000220cf7fe9afe49f0d5053 to your computer and use it in GitHub Desktop.
Save danielpotthast/e368e100000220cf7fe9afe49f0d5053 to your computer and use it in GitHub Desktop.
<?php
class Mailer
{
private $fromEmail;
private $fromName;
private $header;
public function __construct($fromEmail, $fromName, $header)
{
$this->fromEmail = $fromEmail;
$this->fromName = $fromName;
$this->header = "From: $fromName <$fromEmail>\n".$header;
}
public function send($to, $subject, $message)
{
mail($to, $subject, $message, $this->header);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment