Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

Php Mail Report

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
Watch

gauravmm

Established Member
Impact
1
Here is another mail script i wrote...

This handy little script will save up all feedback until a certain size is reached. It will then send a nicely formatted email to your email.
No Refresh Sending!
Send mail without refreshing/changing page from html
Email Buffer
Helps you reduce spam!​

PHP:
<?php
//Destination Email ID
$to = "[email protected]";
//feedback file
$ffile = 'feedback.txt';
//from
$from = "[email protected]";
//check for hacking
if(!isset($_POST['name'])){
	/*********** Hacking Report body *******************/
	$matter = 
	"		  ---HACKING ATTEMPT---
".  
	"IP        : ".$_SERVER['REMOTE_ADDR']."
".
	"Time      : ".date('l dS \of F Y h:i:s A')."
".
	"		  ---END OF REPORT---

";
	/******************************************************/
}else{
	//Name of the Person
	$namenew = $_POST['name'];	
 	//Email Id of the person
	$emailnew = $_POST['email'];	  
	//Feedback detail
	$feedbacknew = $_POST['feedback']; 
	/*********** Report body *******************/
	$matter = 
	"			---REPORT---
".  
	"Name      : ".$namenew."
".
	"Email     : ".$emailnew."
".
	"Suggestion: ".$feedbacknew."
".
	"IP        : ".$_SERVER['REMOTE_ADDR']."
".
	"Time      : ".date('l dS \of F Y h:i:s A')."
".
	"		  ---END OF REPORT---

";
/**********************************************/
}
	$comp = 
	"			---REPORT---
".  
	"Name      : ".$namenew."
".
	"Email     : ".$emailnew."
".
	"Suggestion: ".$feedbacknew."
";
if (stristr(file_get_contents($ffile), $comp) === False){
$fp = fopen($ffile,'a');
fwrite($fp,$matter);
fclose($fp);
if(filesize($ffile)>1000){
	mail($to, "Feedback Report",file_get_contents($ffile),"From: " & $from);
	unlink($ffile);
}
}
header("HTTP/1.0 204 No Content");//no refresh
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Thanks for posting
 
0
Close
nice piece of coding
simple but clean
 
0
Close
DomainEasy: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Filters for activity feeds
Your news feed, Latest activity, and the activity tab on profiles now have filter buttons: All, Posts, Quick replies, and Other. Your...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back