Skip to content

Instantly share code, notes, and snippets.

@MilkZoft
Created February 1, 2012 01:18
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 MilkZoft/1714354 to your computer and use it in GitHub Desktop.
Save MilkZoft/1714354 to your computer and use it in GitHub Desktop.
codejobs - Send an email - PHP
<?php
$to = "example@gmail.com";
$subject = "Follow @codejobs!";
$body = "Body of your message here you can use HTML too. e.g. <br> <b> Bold </b>";
$headers = "From: Peter\r\n";
$headers .= "Reply-To: info@yoursite.com\r\n";
$headers .= "Return-Path: info@yoursite.com\r\n";
$headers .= "X-Mailer: PHP5\n";
$headers .= 'MIME-Version: 1.0' . "\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail($to, $subject, $body, $headers);
?>
Copy link

ghost commented Feb 1, 2012

You shouldn't use snippets like this, better use classes like phpmailer and similiar.

@MilkZoft
Copy link
Author

MilkZoft commented Feb 1, 2012

Yes, you're right!, thanks for the observation :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment