|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Php server email problem
Hey,
I got a website using PHPBE at ncbookexchange.com The problem is that the contact forms aren't sending emails. This is a HUGE problem because it owuld explain why the popularity sucks. Any ideas as to why this would happen? I'm pretty sure that the forms worked when i first installed the script but I never really checked them until recently. Help is urgent as school is beginning soon. Thanks. -luper ps: No errors in error log.. |
|
#2
|
|||
|
|||
|
check your script on the "contact form" you have, maybe there's a slight miss from your scripts.. because if you're the one who's making it, it's easy for you to troubleshoot that problem since you don't have to work on the server.. can i see the link to that contact form? there's a simple illustration to sending details in PHP and have the below script as your guide.. i'm giving you such basic script but the function is the same, just get the logic from it.
code : <?php $to = "someone@exampleDOTcom"; $subject = "Test mail"; $message = "Hello! This is a simple email message."; $from = "someonelse@exampleDOTcom"; $headers = "From: $from"; mail($to,$subject,$message,$headers); echo "Mail Sent."; ?> P.S. |
|
#3
|
|||
|
|||
|
You would need to check first if you are receiving the form values from the form, if you are, it could be that the mail did get sent, but that it ran into trouble afterwards.
If the script that you are using is using the mail function. Then there is a number of things you should realize about sending mail this way. First of all there is a common misconception that mail() actually sends mail. It doesn't. That function simply takes the input you give it and formats it as a MIME message, does minimal filtering and checking and then hands the message off to a MTA (mail tranfer agent like Sendmail, Exim or Postfix). Once that transfer is complete, PHP has no way of knowing when something goes wrong, further down the line. The MTA sends the message, and after that it can go through numerous servers and spam filters before reaching a destination. mail() will return a boolean (true/false) to indicate that the message was transferred to the MTA, but no more than that. You would need to send additional headers along with the message to ensure that it can get through the spam filters. Some mail systems are notorious for rejecting mail sent via PHP. One of the more important headers is the return-path. It is an email address that is set to receive bounced emails. Obviously, if you are a spammer, you don't want your bounced emails, so you won't set that header or you might use a bogus address. Spam filters check for this sort of thing. Hotmail also tends to like to see names next to email addresses for instance. I would recommend using a pre written class such as PHPMailer to send mail, since all these issues have been worked out in that code. Otherwise, sending mail with PHP gets really complicated. When using user input with email, you need to take precautions against mail injection. If you don't, a spammer will eventually find your form (they actively search for these) and use your form to send spam. Your IP address or domain could end up on a blacklist. The cost of getting whitelisted with some email services is more than you want to know. |
|
#4
|
|||
|
|||
|
Reply
Hi,
Can u give me code of your form so that its easy to find the problem with code. Thanks |
|
#5
|
|||
|
|||
|
I would advise against resurrection of threads which are over a year old :p
__________________
~~==~~ Whoever said nothing is impossible never tried pushing a revolving door ~~==~~ |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Applications > Php server email problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|