Spoof Mail


SUBMITTED BY: Guest

DATE: Dec. 7, 2013, 1:25 p.m.

FORMAT: PHP

SIZE: 683 Bytes

HITS: 810

  1. <?php
  2. //define the receiver of the email
  3. $to = 'youraddress@example.com';
  4. //define the subject of the email
  5. $subject = 'Test email';
  6. //define the message to be sent. Each line should be separated with \n
  7. $message = "Hello World!\n\nThis is my first mail.";
  8. //define the headers we want passed. Note that they are separated with \r\n
  9. $headers = "From: webmaster@example.com\r\nReply-To: webmaster@example.com";
  10. //send the email
  11. $mail_sent = @mail( $to, $subject, $message, $headers );
  12. //if the message is sent successfully print "Mail sent". Otherwise print "Mail failed"
  13. echo $mail_sent ? "Mail sent" : "Mail failed";
  14. ?>

comments powered by Disqus