Advertisement
Guest User

Untitled

a guest
Mar 31st, 2012
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. it echos "sent" but i dont get the email nor in the spam folder of my email
  2.  
  3. <?php
  4.  
  5. $to = "ab159ab@hotmail.com";
  6.  
  7. // Windows may not handle this format well
  8. // $to = "Recipient Name <nobody@somedomain.com>";
  9.  
  10. // multiple recipients
  11. // $to = "nobody@somedomain.com, somebody@somedomain.com";
  12. // $to = "Recipient Name <nobody@somedomain.com>, somebody@somedomain.com";
  13.  
  14. $subject = "Mail Test at ".strftime("%T", time());
  15.  
  16. $message = "This is a test.";
  17. // Optional: Wrap lines for old email programs
  18. // wrap at 70/72/75/78
  19. $message = wordwrap($message,70);
  20.  
  21. $from = "Sender Name <somebody@somedomain.com>";
  22. $headers = "From: {$from}\n";
  23. $headers .= "Reply-To: {$from}\n";
  24. // $headers .= "Cc: {$to}\n";
  25. // $headers .= "Bcc: {$to}\n";
  26. $headers .= "X-Mailer: PHP/".phpversion()."\n";
  27. $headers .= "MIME-Version: 1.0\n";
  28. $headers .= "Content-Type: text/plain; charset=iso-8859-1";
  29.  
  30. $result = mail($to, $subject, $message, $headers);
  31. echo $result ? 'Sent' : 'Error';
  32.  
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement