Skip to content

Instantly share code, notes, and snippets.

@gravataLonga
Created June 11, 2018 11:09
Show Gist options
  • Save gravataLonga/5982574c97007732aefe17c78cdeeb22 to your computer and use it in GitHub Desktop.
Save gravataLonga/5982574c97007732aefe17c78cdeeb22 to your computer and use it in GitHub Desktop.
Testing sending email
<?php
function mail_utf8(
$to_name,
$to,
$from_name,
$from,
$reply = '',
$subject = '(No subject)',
$message = ''
)
{
$headers = "From: $from_name<$from>\r\n";
$headers .= "To: $to_name<$to>\r\n";
$headers .= "Reply-To: $reply\r\n";
$headers .= "X-Mailer: PHPV0.1\n";
$headers .= 'MIME-Version: 1.0' . "\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
return mail($to, $subject, $message, $headers);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment