glock- Posted September 9, 2003 Posted September 9, 2003 I'm having problems using the mail function in php w/TCH. ><php $result = mail("mike_blah@hotmail.com", "my subject", "my body"); echo($result); ?> 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? Quote
TCH-Dick Posted September 9, 2003 Posted September 9, 2003 I might be wrong ,but I think the first tag should be <?php. ><?php $result = mail("mike_blah@hotmail.com", "my subject", "my body"); echo($result); ?> Quote
glock- Posted September 9, 2003 Author Posted September 9, 2003 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. Here is the html form: ><form method="POST" action="email.php"> <a class="header">Your E-Mail Address:</a><br> <input type="text" name="email_address"><br><br> <a class="header">Subject of the E-Mail:</a><br> <input type="text" name="subject"><br><br> <a class="header">Your Message:</a><br> <textarea rows="15" name="body" cols="45"></textarea><br> <input type="submit" value="submit" name="submit"> </form> and here is email.php ><?php $email = $_POST['email_address']; $subject = $_POST['subject']; $body = $_POST['body']; $to = "mike_blah@hotmail.com"; $headers = "From: Web Email Form <'$email'>\r\n"; $result = mail($to, $subject, $body); echo($result): ?> The weird thing is no email is generated and I don't even get the echo(result). Quote
glock- Posted September 9, 2003 Author Posted September 9, 2003 Sigh I found the silly error, no more late night programming for me. Quote
TCH-Dick Posted September 9, 2003 Posted September 9, 2003 Glad I could help, it never hurts to have a second set of eyes :Nerd: Quote
glock- Posted September 9, 2003 Author Posted September 9, 2003 Agreed. It always helps, Thanks. Quote
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.