Email Script
Posted: Thu Jan 19, 2006 3:31 pm
Hello All,
Im new here. ANd Im very happy I found this forum.
Hopefully you can help me.
I have a script that sends an email, its a trouble ticket system and it sends me an email when a new ticket is created.
The problem im having is that constantly, i get blank emails from the script, which means someone is just running the .php page that sends the email without the form prior to it. or maybe a crawler or something?
Is there something I can put on the page that sends the email that will not allow it to process unless there is information? or at least to validate that the only way it will continue is if it was redirected from the form page?
Any ideas?
Here is the page that sends the email.
Im new here. ANd Im very happy I found this forum.
Hopefully you can help me.
I have a script that sends an email, its a trouble ticket system and it sends me an email when a new ticket is created.
The problem im having is that constantly, i get blank emails from the script, which means someone is just running the .php page that sends the email without the form prior to it. or maybe a crawler or something?
Is there something I can put on the page that sends the email that will not allow it to process unless there is information? or at least to validate that the only way it will continue is if it was redirected from the form page?
Any ideas?
Here is the page that sends the email.
Code: Select all
<?php
$to = "emailaddress"\r\n";
$re = "Ticket Updated by Customer # $ticketid";
$From = "From: techsupport@techsupport.com\r\n";
$body = <<< emailbody
Dear Technician.
An update has been posted to a ticket, # $ticketid
The customer wrote
$comment
If this update requires a response from you, please go to the support site and reply.
----------------------------------------------------
Sincerely,
Tech Support
emailbody;
$success = mail($to,$re,$body,$From);
?>