Skip to content

Instantly share code, notes, and snippets.

@lukemorton
Created May 20, 2010 15:13
Show Gist options
  • Save lukemorton/407679 to your computer and use it in GitHub Desktop.
Save lukemorton/407679 to your computer and use it in GitHub Desktop.
<?php
// Most simple mail()
mail(
'Luke <[email protected]>',
'Testing 1',
'This is the main message!!'
);
// mail() with additional headers
mail(
'Luke <[email protected]>',
'Testing 2',
'This is the main message!!',
'From: Luke 2 <[email protected]>' . "\r\n" .
'Reply-To: Luke 3 <[email protected]>' . "\r\n"
);
// mail() with additional headers and -f
mail(
'Luke <[email protected]>',
'Testing 3',
'This is the main message!!',
'From: Luke 2 <[email protected]>' . "\r\n" .
'Reply-To: Luke 3 <[email protected]>' . "\r\n",
'-f [email protected]'
);
// With proper name in -f
mail(
'Luke <[email protected]>',
'Testing 4',
'This is the main message!!',
'From: Luke 2 <[email protected]>' . "\r\n" .
'Reply-To: Luke 3 <[email protected]>' . "\r\n",
'-f Proper Name <[email protected]>'
);
// With proper name in -f and no headers
mail(
'Luke <[email protected]>',
'Testing 5',
'This is the main message!!',
null,
'-f Proper Name <[email protected]>'
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment