Jump to content

mail() not working


PC Nerd

Recommended Posts

hi.

 

ive got this small site, and theres two different forms, which both send emails to an email address. 

the first set of code below works, however the second one doesnt.  the second one returns things like the actual mailserver url, and the message body only has "0", probably boolean/"false".

 

Ive got the tech guys at me server looking into it, but im wondering if its with my code.

 

if anyone has any ideas on whats happening. i would really appreciate your help.

thanks

 


$To = "email";
$From = "email";
$Name = "NAME";
$Title = "TITLE";
$Message = "MESSAGE";


$Subject = "Web Site Inquiry: \"".$Title."\"";
$Body = $Name." has sent an email from the website.  The message is below.  You can reply to their email, simply by clicking on the reply button / link in your email program.<br><br><br><br><br><br>Message:<br><br><br>".$Message."<br><br><br>";
$Header = "From:".$From;

$Mail_Sent = @mail($To, $Subject, $Message, $Header) or die("Email Failed to send.  Please contact the Webmaster at [email protected].  We apologies for any inconveinience.");

 

 


$message = "Test ing this email";

$to = "[email protected]";
$subject = "Details Update";
$email = mail($to, $subject, $message, "From:[email protected]") or die("Email failed to send");

 

 

 

please note, that the working email, the first set...... uses $_POST data, and not static variables, for the first set of variables... however ive simply replaced its value.

 

thanks

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

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.