PC Nerd Posted July 11, 2007 Share Posted July 11, 2007 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 Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted July 11, 2007 Author Share Posted July 11, 2007 ok, tech got back, and said to explicitly state teh mailserver as localhost, however im having trouble finding a way. does anyone know how to do this? thanks Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted July 11, 2007 Author Share Posted July 11, 2007 ive got it working, thanks though Quote Link to comment Share on other sites More sharing options...
Yesideez Posted July 11, 2007 Share Posted July 11, 2007 If you use something like this you can specificy a name for "from" as well: From: Horizon Accounting <horizon.accounting@gmail.com> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.