Mail() Configured Correctly In Php.ini?

liunx

Guest
I'm having problems using the mail function in php w/TCH.<br /><br /><!--coloro:red--><span style="color:red"><!--/coloro--><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><php<br />$result = mail("[email protected]", "my subject", "my body");<br />echo($result);<br />?><!--c2--></div><!--ec2--><!--colorc--></span><!--/colorc--><br /><br />Even this snippet of code wont generate an email or even post me the $result. Any suggestions are welcome. Is mail not configured properly? have other people tried using mail() and had it work successfully?<!--content-->
I might be wrong ,but I think the first tag should be <!--coloro:red--><span style="color:red"><!--/coloro--><?php<!--colorc--></span><!--/colorc-->.<br /><br /><!--coloro:red--><span style="color:red"><!--/coloro--><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><?php<br />$result = mail("[email protected]", "my subject", "my body");<br />echo($result);<br />?><!--c2--></div><!--ec2--><!--colorc--></span><!--/colorc--><!--content-->
Crazee,<br /><br />Looks good from here.<!--content-->
Doh, yeah stupid mistake forgetting the ?, it was a late night. I wrote that simple code because I'm having a bigger problem trying to do the same thing, maybe you can help.<br /><br />Here is the html form:<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><form method="POST" action="email.php"><br />  <a class="header">Your E-Mail Address:</a><br><br />  <input type="text" name="email_address"><br><br><br />  <a class="header">Subject of the E-Mail:</a><br><br />  <input type="text" name="subject"><br><br><br />  <a class="header">Your Message:</a><br><br />  <textarea rows="15" name="body" cols="45"></textarea><br><br />  <input type="submit" value="submit" name="submit"><br /></form><!--c2--></div><!--ec2--><br /><br />and here is email.php<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><?php<br />        $email = $_POST['email_address'];<br />        $subject = $_POST['subject'];<br />        $body = $_POST['body'];<br />        $to = "[email protected]";<br />        $headers = "From: Web Email Form <'$email'>\r\n";<br /><br />        $result = mail($to, $subject, $body);<br />        echo($result):<br />?><!--c2--></div><!--ec2--><br /><br />The weird thing is no email is generated and I don't even get the echo(result).<!--content-->
Sigh <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /><br /><br />I found the silly error, no more late night programming for me.<!--content-->
Glad I could help, it never hurts to have a second set of eyes :Nerd:<!--content-->
Agreed. It always helps, Thanks.<!--content-->
 
Back
Top