Phantom
05-07-2003, 10:28 PM
A new problem has evolved in my expedition, and I don't know WTF the problem with it is. I'm trying to use PHP's mail() function to send a confirmation email, but it isn't sending the email.
} else { // Everything went ok, or did it?
createMessage('r');
$message = $out;
$db = new dbStuff;
$db->dbM("INSERT INTO ${table} SET name = '$uname', email = '$uemail', domain = '$udomain', issue = '$uissue', date = ".time().", status = '2'"); // Status? Well, status=0 means closed, 1 means open, 2 means pending
$db->dbQ("SELECT * FROM ${table} WHERE name = '$uname'");
$client = $db->dbR();
$mail = new mailStuff;
$mailHead = "From: $display<$email>\r\n";
$mailHead .= "Reply-to: <$email>\r\n";
$subject = "Support Ticket: ID-$client['id']";
$mail->sendMail($uemail, $subject,$message, $mailHead);
echo "<script>alert('All of the information entered was correct, and an email has been sent to $uemail. One of our Tech Support Specialists will view your issue and get back to you shortly. Have a nice day!');</script>";
}
The $mail->sendMail function
function sendMail($to,$subject,$message, $headers) {
if(isset($to) && isset($subject) && isset($message) && isset($headers)) {
mail($to, $subject, $message, $headers);
}
}
The $u variables (uemail, udomain, etc) are set via a form, comprised of 3 textboxes and 1 textarea (textarea being the issue). The variables $display and $email are set via a configuration file. I don't know what the problem is, but I beleive it lies in the headers I'm trying to use to send the email, though it does seem that as the script parses, it just skips the whole part where it's supposed to send the mail and goes straight to the alert. Any help would be appreciated :-)
Thanks!
} else { // Everything went ok, or did it?
createMessage('r');
$message = $out;
$db = new dbStuff;
$db->dbM("INSERT INTO ${table} SET name = '$uname', email = '$uemail', domain = '$udomain', issue = '$uissue', date = ".time().", status = '2'"); // Status? Well, status=0 means closed, 1 means open, 2 means pending
$db->dbQ("SELECT * FROM ${table} WHERE name = '$uname'");
$client = $db->dbR();
$mail = new mailStuff;
$mailHead = "From: $display<$email>\r\n";
$mailHead .= "Reply-to: <$email>\r\n";
$subject = "Support Ticket: ID-$client['id']";
$mail->sendMail($uemail, $subject,$message, $mailHead);
echo "<script>alert('All of the information entered was correct, and an email has been sent to $uemail. One of our Tech Support Specialists will view your issue and get back to you shortly. Have a nice day!');</script>";
}
The $mail->sendMail function
function sendMail($to,$subject,$message, $headers) {
if(isset($to) && isset($subject) && isset($message) && isset($headers)) {
mail($to, $subject, $message, $headers);
}
}
The $u variables (uemail, udomain, etc) are set via a form, comprised of 3 textboxes and 1 textarea (textarea being the issue). The variables $display and $email are set via a configuration file. I don't know what the problem is, but I beleive it lies in the headers I'm trying to use to send the email, though it does seem that as the script parses, it just skips the whole part where it's supposed to send the mail and goes straight to the alert. Any help would be appreciated :-)
Thanks!