Jump to content

[SOLVED] Sending Email Problem


SkyRanger

Recommended Posts

Not sure why this is not send out the email.  Anybody have any ideas, or is there a way to test the problem?

 

if ($submit) {

$email = $semail; // Recive this by your email adress
$subject = "Support - Ticket Number: $ticketno"; // Replace this by a subject
$message = "
======================================================

Ticket Number: $ticketno

Date of request: $sdate

Subject: $ssubject

Description:
$formmessage

To reply to this message, or send another ticket click below:
http://$dbdomain

Please do not reply to this message.

======================================================

From: $dbemail
";

$header = "From: $dbemail\r\n";

if (mail($email, $subject, $message, $headers)) {
$report = "Response sent";
} else {
$report = "Your response could not be sent";
}

echo "<b>$report</b>";

echo "<br><br>";

        $connectionu=mysql_connect ("$dblocation", "$dbusername", "$dbpassword") or die ('I cannot connect to the database because: ' . mysql_error());
        mysql_select_db ("$dbname");
        mysql_db_query("$dbname", "UPDATE support SET status = 'completed', admin = '$adminname' WHERE ticketno = '$ticketno'") or die('I cannot update the database because: ' . mysql_error());

$sql = "INSERT INTO support_replies (ticketno,description,date,user) VALUES ('$ticketno','$formmessage','time()','$adminname')";
$result = mysql_query($sql) or die ('I could not add information to the database because ' . mysql_error());
        mysql_close($connectionu);

echo "Please click here to return to the:<br><a href=index2.php>$dbcompany Manager Index</a>";

 

I echoed all of the $ to make sure it displays and it does, it just won't send out the email.

Link to comment
https://forums.phpfreaks.com/topic/47302-solved-sending-email-problem/
Share on other sites

Are you trying to send it to an email on your server or off? IE [email protected]  or [email protected]

 

I would try to send one to an off site email account and see what happens. Sometimes mail function does funky things when you are sending it to the domain you are currently on. If that does not work I would suggest going to www.php.net/mail  and looking at the mail function particulary the "-f" portion.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.