Here under you'll find the php script that sends the information from my flashform to a given email adress.
It works fine, except one thing. When the mail is sent, me@localhost.com is put in the FROM line before the emailadress I put in $adminaddress. Therefore most mailprograms consider this mail as spam.
My question : how can i make to disapear this me@localhost.com in the From-line.
Thanx
The code :
<?
// Enter your contact email address here
$adminaddress = "info@fortuin.be";
// Enter the address of your website here include http://www.
$siteaddress ="http://www.fortuin.be";
// Enter your company name or site name here
$sitename = "Fortuin";
/*******************************************************
No need to change anything below ...
*******************************************************/
// Gets the date and time from your server
$date = date("m/d/Y H:i:s");
// Gets the IP Address
if ($REMOTE_ADDR == "") $ip = "no ip";
else $ip = getHostByAddr($REMOTE_ADDR);
//Process the form data!
// and send the information collected in the Flash form to Your nominated email address
if ($action != ""):
mail("$adminaddress","Info Request",
"A visitor at $sitename has left the following information\n
Voornaam: $fname
Naam: $lname
Email: $email
Bedrijf: $cname
Btw nr: $btw
Straat: $straat
Huisn°: $huisn
Postcode: $postc
gemeente: $gemeente
Telephone: $telno
Fax: $fax
GSM: $gsm\n
Info: $info, $info2, $info3, $info4, $info5, $info6, $info7, $info8
The visitor commented:
$comments
Logged Info :
Using: $HTTP_USER_AGENT
Hostname: $ip
IP address: $REMOTE_ADDR
Date/Time: $date","FROM:$adminaddress");
//This sends a confirmation to your visitor
mail("$email","Thank You for visiting $sitename",
"Hi $fname,\n
Thank you for your interest in $sitename!\n
Cheers,
$sitename
$siteaddress","FROM:$adminaddress");
//Confirmation is sent back to the Flash form that the process is complete
$sendresult = "Thank you for visiting <a href = \"$siteaddress\" target = \"_blank\"><u>$sitename</u></a>. You will receive a confirmation email shortly. ";
$send_answer = "answer=";
$send_answer .= rawurlencode($sendresult);
echo "$send_answer";
endif;
?>