This is a discussion on "email problem again" within the PHP Forum section. This forum, and the thread "email problem again are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
email problem again
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
email problem again
Right i got the basic mail() function to work but i need a if statement. So i did the following code.
<?php $Firdge = $_POST['ChkFridge']; $Pool = $_POST['ChkPool']; if (mail('EMAIL ADDRESS','Form feedback','Message here', 'From: email.com')){ print("<p>Thank you for your enquiry, please go back</p>"); }else{ print("<p>An unknown error has occured, please go back</p>"); } ?> It seems to work i dont get any errors and the thank you is printed on the screen, i check my inbox but no mail is being sent. |
|
|
|
#2
|
|||
|
|||
|
Re: email problem again
Your if statement is checking to see if the mail function is true, it's not performing the mail function.
You want to say, if 'somethings true', then send the email and print 'thankyou for your enquiry' - else, print 'an unknown error has occured'... if (somethings true) { mail('EMAIL ADDRESS','Form feedback','Message here', 'From: email.com'); print("<p>Thank you for your enquiry, please go back</p>"); }else{ print("<p>An unknown error has occured, please go back</p>"); } Just post again if you have more questions Cheers, Jim. |
|
#3
|
|||
|
|||
|
Re: email problem again
thank you for the info, so simple lol
|
|
#4
|
|||
|
|||
|
Re: email problem again
mail() is a boolean function and therefore returns true or false as appropriate. It is more likely, looking at your code, that your email is being filtered out as spam because your From: email address is not a valid format. |
![]() |
| Tags |
| email, problem, again |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| problem of valiadation of email | begeiste | PHP Forum | 5 | Oct 11th, 2007 17:40 |
| Problem sending Multiple Attachments w/Email | wacara | Classic ASP | 0 | Aug 9th, 2007 19:50 |
| Dreamweaver Email ATT File Problem | Flyaheli | PHP Forum | 7 | Aug 4th, 2007 06:47 |
| HTML Email Problem!?!?!? | uqwebdesign | Web Page Design | 12 | Feb 22nd, 2007 07:12 |
| asp.net send email problem | sunnyko | ASP.NET Forum | 5 | Sep 12th, 2006 10:31 |