| | #1 |
| HyperActive Warrior Join Date: 2009
Posts: 212
Thanks: 11
Thanked 5 Times in 5 Posts
|
So I have a simple form the php code to send shoots out the reply that it was sent but nothing coming in email - why? PHP Code: |
| |
| | #2 |
| Toltec Warrior War Room Member Join Date: 2011 Location: Australia
Posts: 95
Thanks: 2
Thanked 23 Times in 22 Posts
|
code looks okay, perhaps it is being filtered and so not received... check your spam folder and/or test a different email address? |
| | |
| |
| | #3 |
| Active Warrior Join Date: 2014
Posts: 84
Thanks: 5
Thanked 11 Times in 10 Posts
|
To send email with 'mail' you need a mail server (like postfix,sendmail,exim etc) installed and set up on the server that's running your php. It might be very hard to do that if you're not an IT Pro / sys admin or know your stuff about mail servers, it's really tricky. If you can I would recommend using 3rd party mail server infrastructure like Mandrill or Mailgun . Both of them have free tiers ( 12,000 emails a month I think ) . And you can be pretty much sure that your mail will be delivered ( unless you're spamming , have high bounce rate etc ). It's quite simple to use i.e. SwiftMailer for PHP to send mails with either of those .
|
| |
| | #4 |
| HyperActive Warrior Join Date: 2009
Posts: 212
Thanks: 11
Thanked 5 Times in 5 Posts
|
Thank you for your reply - I find it strange cause this is the only domain on my server that won't send mail.. does it have anything to do with the fact that I'm working on Wordpress? the form itself is on a page in wordpress and form submitting to mydomain.com/phpfile.php again I get the email sent reply but nothing comes through - I have another site on the same server and get mail no problem??
|
| |
| | #5 |
| HyperActive Warrior Join Date: 2009
Posts: 212
Thanks: 11
Thanked 5 Times in 5 Posts
|
Ok following the advice here I tried a different email address to send to and that does work.... STRANGE hotmail not going to junk or anything just not going period??
|
| |
| | #6 |
| Conceited Know-It-All Join Date: 2014 Location: Amurrica
Posts: 952
Thanks: 465
Thanked 1,136 Times in 503 Posts
|
My guess is hotmail's spam protection is preventing your message from getting through. If I had to guess why, I'd venture to say that it doesn't recognize the server you're sending from as being a valid sender for your FROM email address. If you want to ensure deliverability, your best bet is to go through an established transactional email service such as SendGrid, SES, or Mandril (and there are plenty of others). Alternatively, make sure your SPF records are set for your domain's DNS and that they point to the correct servers.
|
| | |
| |
| | #7 |
| Toltec Warrior War Room Member Join Date: 2011 Location: Australia
Posts: 95
Thanks: 2
Thanked 23 Times in 22 Posts
|
if you are on wordpress anyway, why not use the wp_mail function instead of mail() and put the php file in your /wp-content/mu-plugins/ folder ? ...you may need to wrap it as a function and add it to an action hook tho, eg. add_action('init','custom_email_sender'); function custom_email_sender() {YOUR CODE;} then you just can just remove the form target that is pointing to the php file, because it will be handled by any wordpress url this way. this way you can install a mail logging plugin too and that might help you see what else might be going on there, or you could even install an smtp plugin to route the mail etc. |
| | |
| |
|
| Bookmarks |
| Tags |
| form, sending |
| |