Hey thanks for the reply as I have now changed everything to use phpmailer. How would I now then edit the following to embed my clients logo to appear in my clients email when someone uses the form.
<?php
/* config start */
$emailAddress = 'test@hotmail.com';
/* config end */
require "phpmailer/class.phpmailer.php";
session_name("solisten");
session_start();
foreach($_POST as $k=>$v)
{
if(ini_get('magic_quotes_gpc'))
$_POST[$k]=stripslashes($_POST[$k]);
$_POST[$k]=htmlspecialchars(strip_tags($_POST[$k]));
}
$err = array();
if(!checkLen('name'))
$err[]='The name field is too short or empty!';
if(!checkLen('billing'))
$err[]='The billing name and address field is too short or empty!';
if(!checkLen('town'))
$err[]='The town field is too short or empty!';
if(!checkLen('zip'))
$err[]='The zip code / postal field is too short or empty!';
if(!checkLen('country'))
$err[]='The country field is too short or empty!';
if(!checkLen('email'))
$err[]='The email field is too short or empty!';
else if(!checkEmail($_POST['email']))
$err[]='Your email is not valid!';
if((int)$_POST['captcha'] != $_SESSION['expect'])
$err[]='The verification code is wrong!';
if(count($err))
{
if($_POST['ajax'])
{
echo '-1';
}
else if($_SERVER['HTTP_REFERER'])
{
$_SESSION['errStr'] = implode('<br />',$err);
$_SESSION['post']=$_POST;
header('Location: '.$_SERVER['HTTP_REFERER']);
}
exit;
}
$msg=
'IP: '.$_SERVER['REMOTE_ADDR'].'<br />
Name: '.$_POST['name'].'<br />
Billing: '.$_POST['billing'].'<br />
Town: '.$_POST['town'].'<br />
Zip: '.$_POST['zip'].'<br />
Country: '.$_POST['country'].'<br />
Phone: '.$_POST['phone'].'<br />
Mobile: '.$_POST['mobile'].'<br />
Fax: '.$_POST['fax'].'<br />
Email: '.$_POST['email'].'<br />
Webpage: '.$_POST['web'].'<br /><br />
Education and Current Activity: '.nl2br($_POST['educ']).'<br /><br />
Comments: '.nl2br($_POST['message']).'
';
$mail = new PHPMailer();
$mail->IsMail();
$mail->AddReplyTo($_POST['email'], $_POST['name']);
$mail->AddAddress($emailAddress);
$mail->SetFrom($_POST['email'], $_POST['name']);
$mail->Subject = "Solisten message from ".$_POST['name']." | Inquiry and Reg Form";
$mail->MsgHTML($msg);
$mail->Send();
unset($_SESSION['post']);
if($_POST['ajax'])
{
echo '1';
}
else
{
$_SESSION['sent']=1;
if($_SERVER['HTTP_REFERER'])
header('Location: '.$_SERVER['HTTP_REFERER']);
exit;
}
function checkLen($str,$len=2)
{
return isset($_POST[$str]) && mb_strlen(strip_tags($_POST[$str]),"utf-8") > $len;
}
function checkEmail($str)
{
return preg_match("/^[\.A-z0-9_\-\+]+[@][A-z0-9_\-]+([.][A-z0-9_\-]+)+[A-z]{1,4}$/", $str);
}
?>