Skip to content

Instantly share code, notes, and snippets.

@ar7n
Created February 4, 2016 13:56
Show Gist options
  • Save ar7n/8167235534b39e6106ff to your computer and use it in GitHub Desktop.
Save ar7n/8167235534b39e6106ff to your computer and use it in GitHub Desktop.
Send email by php
<?php
$headers = array();
$headers[] = "MIME-Version: 1.0";
$headers[] = "Content-type: text/html; charset=utf-8";
$headers[] = "From: Sender Name <sender@domain.com>";
$headers[] = "Bcc: JJ Chong <bcc@domain2.com>";
$headers[] = "Reply-To: Recipient Name <receiver@domain3.com>";
$headers[] = "Subject: {$subject}";
$headers[] = "X-Mailer: PHP/".phpversion();
mail($to, $subject, $email, implode("\r\n", $headers));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment