Hi,
I have a PHP based email from on a clients site, it puts the information from the form in a variable and sends, whoever is designated, an email. What I want to have is in the email it sends to have a link that says, “Click here to add this contact to you Outlook Address Book!”
A. Is this possible?
B. Can someone help me do it?
Here is the code I have so far:
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','name');
pt_register('POST','address1');
pt_register('POST','address2');
pt_register('POST','city');
pt_register('POST','state');
pt_register('POST','zip');
pt_register('POST','phone');
pt_register('POST','email');
pt_register('POST','comments');
if($name=="" || $email=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$email)){
$error.="<li>Invalid email address entered";
$errors=1;
}
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message= "Name: ".$name."
Address Line 1: ".$address1."
Address Line 2: ".$address2."
City: ".$city."
State: ".$state."
Zip: ".$zip."
Phone: ".$phone."
Email Address: ".$email."
Comments: ".$comments."
";
$message = stripslashes($message);
mail("[email protected]","From: www.alexsandrapappas.com",$message,"You have received a message from www.alexsandrapappas.com. Please read and reply to the message at your earliest convenience.");
$to_put="";
$to_put .= $name."|".$address."|".$city."|".$state."|".$zip."|".$phone."|".$email."|".$service."
";
header("Refresh: 0;url=http://www.alexsandrapappas.com/thank_you.html");
}
?>