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("admin@mydomain.com", $subject, $message, $from);

}

?>

 

Thanks in advance.

Raz

Link to comment
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("admin@video.english-hooligans.co.uk", $subject, $message, $from);

}

?>

 

Thanks again,

Raz

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.