lelu
03-20-2007, 01:40 PM
I am a new to PHP.
can not figure out how to send an e-mail through website to hotmail directly and not to info@easyto.eu?
thank you.
<?
if($Submitted){
$arrError = array();
if(empty($Email)){
array_push($arrError,'E-mail address is required!');
}else{
$strRegularExpression='/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-].+(\.[a-z0-9-]+)+$/';
if((!preg_match("$strRegularExpression","$Email",$array))){
array_push($arrError,'E-mail address is invalid!');
}
}
if(empty($Address)){
array_push($arrError,'Business address is required!');
}
if(empty($Message)){
array_push($arrError,'Message address is required!');
}
$strReturnMessage = '';
if(count($arrError)==0){
//send email
$headers = '';
$headers .= "From: $BusinessName<$Email>\n";
$headers .= "Reply-To: $BusinessName<$Email>\n";
$headers .= "Date: ".date("r")."\n";
$headers .= "Message-ID: <".date("YmdHis")."someone@hotmail.com".$_SERVER['SERVER_NAME'].">\n";
$headers .= "Return-Path: <someone@hotmail.com>\n";
$headers .= "Delivered-to: <someone@hotmail.com>\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\n";
$headers .= "X-Priority: 1\n";
$headers .= "Importance: High\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "X-Mailer: SelmanD Mailler With PHP!\n";
$strSubject = "Contact via someone@hotmail.com";
$strMessage = "Business name: $BusinessName<br>";
$strMessage .= "Business website: $WebsiteName<br>";
$strMessage .= "E-mail: $Email<br>";
$strMessage .= "Business address: $Address<br>";
$strMessage .= "Message: $Message<br>";
mail('info@easyto.eu', $strSubject, $strMessage, $headers);
$strReturnMessage = 'Thank you! we will contact you as soon as possible';
$BusinessName ='';
$WebsiteName ='';
$Email = '';
$Address ='';
$Message ='';
}else{
//Get the error message (s)
$strReturnMessage = '';
for($i=0;$i<count($arrError);$i++){
$strReturnMessage.= $arrError[$i]."<br>";
}
}
}
?>
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns="http:///TR/REC-html40">
can not figure out how to send an e-mail through website to hotmail directly and not to info@easyto.eu?
thank you.
<?
if($Submitted){
$arrError = array();
if(empty($Email)){
array_push($arrError,'E-mail address is required!');
}else{
$strRegularExpression='/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-].+(\.[a-z0-9-]+)+$/';
if((!preg_match("$strRegularExpression","$Email",$array))){
array_push($arrError,'E-mail address is invalid!');
}
}
if(empty($Address)){
array_push($arrError,'Business address is required!');
}
if(empty($Message)){
array_push($arrError,'Message address is required!');
}
$strReturnMessage = '';
if(count($arrError)==0){
//send email
$headers = '';
$headers .= "From: $BusinessName<$Email>\n";
$headers .= "Reply-To: $BusinessName<$Email>\n";
$headers .= "Date: ".date("r")."\n";
$headers .= "Message-ID: <".date("YmdHis")."someone@hotmail.com".$_SERVER['SERVER_NAME'].">\n";
$headers .= "Return-Path: <someone@hotmail.com>\n";
$headers .= "Delivered-to: <someone@hotmail.com>\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\n";
$headers .= "X-Priority: 1\n";
$headers .= "Importance: High\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "X-Mailer: SelmanD Mailler With PHP!\n";
$strSubject = "Contact via someone@hotmail.com";
$strMessage = "Business name: $BusinessName<br>";
$strMessage .= "Business website: $WebsiteName<br>";
$strMessage .= "E-mail: $Email<br>";
$strMessage .= "Business address: $Address<br>";
$strMessage .= "Message: $Message<br>";
mail('info@easyto.eu', $strSubject, $strMessage, $headers);
$strReturnMessage = 'Thank you! we will contact you as soon as possible';
$BusinessName ='';
$WebsiteName ='';
$Email = '';
$Address ='';
$Message ='';
}else{
//Get the error message (s)
$strReturnMessage = '';
for($i=0;$i<count($arrError);$i++){
$strReturnMessage.= $arrError[$i]."<br>";
}
}
}
?>
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns="http:///TR/REC-html40">