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 Webmaster@horizonaccounting.com.  We apologies for any inconveinience.");

 

 


$message = "Test ing this email";

$to = "isjackawesome@gmail.com";
$subject = "Details Update";
$email = mail($to, $subject, $message, "From:horizon.accounting@gmail.com") 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
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.