Hi everyone, I have upgraded my php to level 2, hoping that this would allow my php script for sending the results of an order form to work. It has not. But as I am very new to all web programming, and copied most of the code from an example, I wondered whether it was a problem with the code. Here is what I have:
<?php
require_once "Order.php";
$mailto = "order@titan-tech.co.uk";
$subject = "Titan-Tech Order Form";
$body = "The following confirms the details of your order:\n";
$body .= "\n\n";
$body .= "Name: " . $Fname . "\n";
$body .= "Surname: " . $Sname . "\n";
$body .= "Email: " . $email . "\n";
$body .= "Budget: " . $budget . "\n";
$body .= "\n\n";
$body .= "Computer Use: " . $Compuse . "\n";
$body .= "Specific Requirements: " . $SpecCom . "\n";
$body .= "Elite: " . $Elite . "\n";
$body .= "Monitor: " . $monitor . "\n";
$body .= "Keyboard: " . $keyboard . "\n";
$body .= "Mouse: " . $mouse . "\n";
$body .= "Speakers: " . $speakers . "\n";
$body .= "\n";
$host = "ssl://smtp.gmail.com";
$port = 465;
$username = "titantechcomputers@googlemail.com";
$password = "***********";
$headers = array ('From' => $email,
'To' => $mailto,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'port' => $port,
'auth' => true,
'username' => $username,
'password' => $password, 'persist' => true));
$mail = $smtp->send($mailto, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
echo("<p>Message successfully sent!</p>");
}
?>
I get the error message::dunno:
Fatal error: Class 'Mail' not found in /home/indiana/public_html/Order.php on line 31
Help is much appreciated, thank you
<?php
require_once "Order.php";
$mailto = "order@titan-tech.co.uk";
$subject = "Titan-Tech Order Form";
$body = "The following confirms the details of your order:\n";
$body .= "\n\n";
$body .= "Name: " . $Fname . "\n";
$body .= "Surname: " . $Sname . "\n";
$body .= "Email: " . $email . "\n";
$body .= "Budget: " . $budget . "\n";
$body .= "\n\n";
$body .= "Computer Use: " . $Compuse . "\n";
$body .= "Specific Requirements: " . $SpecCom . "\n";
$body .= "Elite: " . $Elite . "\n";
$body .= "Monitor: " . $monitor . "\n";
$body .= "Keyboard: " . $keyboard . "\n";
$body .= "Mouse: " . $mouse . "\n";
$body .= "Speakers: " . $speakers . "\n";
$body .= "\n";
$host = "ssl://smtp.gmail.com";
$port = 465;
$username = "titantechcomputers@googlemail.com";
$password = "***********";
$headers = array ('From' => $email,
'To' => $mailto,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'port' => $port,
'auth' => true,
'username' => $username,
'password' => $password, 'persist' => true));
$mail = $smtp->send($mailto, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
echo("<p>Message successfully sent!</p>");
}
?>
I get the error message::dunno:
Fatal error: Class 'Mail' not found in /home/indiana/public_html/Order.php on line 31
Help is much appreciated, thank you
Last edited: