Hi,
I am sending an email using php…and flagging up with the error
Parse error: parse error, expecting `T_STRING’ in C:\HostingSpaces\domain\mydomain.com\wwwroot\ est\plaincart\plaincart\controllers\contact_controller.class.php on line 4
Please see the code below and let me know where I mistook.
include("../library/config.php");
include("contact_controller.php");
class contact extends function
{
function add($post)
{
$from = "Customer Care <info@mydomain.com>";
$to = "Admin <me@gmail.com>";
$subject = "Message from Customer";
$body = "Dear Admin,
A customer ".$post['inpperson'].", has asked a quote, detials are:
Email: ".$post['inpemail']."Phone: ".$post['inphone']." Mobile: ".$post['inpmob']."State: ".$post['inpstate']."City: ".$post['txtothercity']."
Message
".$post['message']."";
$host = "mail.mydomain.com";
$username = "info@mydomain.com";
$password = "135446";
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $body);
$headers.="Content-type: text/html". "charset=iso-8859-1\\r\
";
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
return false;
} else {
return true;
}
}
function getcity($state)
{
$sql="select * from tblcity where st_id =$state";
$result = dbQuery($sql);
return $result;
}
}
Your help would be appreciated.