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 <supportlm@myfreeola.com>',
'Testing 1',
'This is the main message!!'
);
// mail() with additional headers
mail(
'Luke <supportlm@myfreeola.com>',
'Testing 2',
'This is the main message!!',
'From: Luke 2 <supportlm@myfreeola.com>' . "\r\n" .
'Reply-To: Luke 3 <supportlm@myfreeola.com>' . "\r\n"
);
// mail() with additional headers and -f
mail(
'Luke <supportlm@myfreeola.com>',
'Testing 3',
'This is the main message!!',
'From: Luke 2 <supportlm@myfreeola.com>' . "\r\n" .
'Reply-To: Luke 3 <supportlm@myfreeola.com>' . "\r\n",
'-f supportlm@myfreeola.com'
);
// With proper name in -f
mail(
'Luke <supportlm@myfreeola.com>',
'Testing 4',
'This is the main message!!',
'From: Luke 2 <supportlm@myfreeola.com>' . "\r\n" .
'Reply-To: Luke 3 <supportlm@myfreeola.com>' . "\r\n",
'-f Proper Name <supportlm@myfreeola.com>'
);
// With proper name in -f and no headers
mail(
'Luke <supportlm@myfreeola.com>',
'Testing 5',
'This is the main message!!',
null,
'-f Proper Name <supportlm@myfreeola.com>'
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment