Jump to content

Mail script not working


razta

Recommended Posts

Hello,

Ive modified my mail script and its decided not to work. The php page goes to the else statement as if it has sent but no email recived. Any suggestions?

 

<?php

if(empty($user) || empty($title) || empty($desc) || empty($embedcode)) {
echo '<div align="center"><h2><font color="red">ERROR! Fill in all fields! Use back button.</font></h2></div>';

exit;

}

else {

$user = Trim(stripslashes($user));
$title = Trim(stripslashes($title));
$desc = Trim(stripslashes($desc));
$embedcode = Trim(stripslashes($embedcode)); 

$message = " echo 'date('l, F j, Y, g:i a')' \n
Title: $user ($title)\n
Description: $desc \n
Embed code: $embedcode \n
Additional Info : IP = $ip \n
Browser Info: $httpagent \n
Referral : $httpref \n
";


$from = "From: $user\r\n";
$subject = $desc;

mail("[email protected]", $subject, $message, $from);

}

?>

 

Thanks in advance.

Raz

Link to comment
https://forums.phpfreaks.com/topic/45575-mail-script-not-working/
Share on other sites

Amended the code as you suggested and no errors came up. Ive also changed the code a little and still no joy.

 

<?php

ini_set("display_errors", 1);
error_reporting(E_ALL);

if(empty($user) || empty($title) || empty($desc)) {
echo '<div align="center"><h2><font color="red">ERROR! Fill in all fields! Use back button.</font></h2></div>';
}

if(empty($embedcode)) {
echo '<div align="center"><h2><font color="red">ERROR! Please give an embed code. Use back button.</font></h2></div>';
}

else {

$user = Trim(stripslashes($user));
$title = Trim(stripslashes($title));
$desc = Trim(stripslashes($desc));
$embedcode = Trim(stripslashes($embedcode)); 

$message = " echo 'date('l, F j, Y, g:i a')' \n
Title: $user ($title)\n
Description: $desc \n
Embed code: $embedcode \n
Additional Info : IP = $ip \n
Browser Info: $httpagent \n
Referral : $httpref \n
";


$from = "From: $user\r\n";
$subject = $desc;

mail("[email protected]", $subject, $message, $from);

}

?>

 

Thanks again,

Raz

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.