I waslooking writing a contact form using PHPs mail function and it works fine;however, not on the server the website will be on. I found this to be because the ISP connecting the server to the internet usually blocks outgoing through port 25.
And the owner of the server has disabled SMTP due to this.
I have a nested directory in the server outside of the root (obviously since it's not my server).
Is there a way I can enable SMTP just for me?
Proxying to use a different port?
Regardless of the ideas above, I was wondering if anyone has any solution or ideas on how to get my contact form to actually send the email. Not send it and have the server block the outgoing email before it gets to me.
Thanks in Advance &all Best Regards,
I could be wrong, but I wouldn't think that this affects the operation of a PHP form. How have you set it up?
I apologise for the late reply.
I was delayed with some other work. Thank you for helping me attempting to or hopefully successfully solving this.
Here is the contact form that sends and email to me once it is successfully submitted. Its on the server space that I mentioned above.
For some reason the form submits successfully, but I never get the email.
The owner of the server said that he disabled SMTP for the reasons mentioned above.
At first, I thought it was something wrong with the php in the form, so I wrote up another file that just runs the PHP mail function when the page is visited, but that doesn't send me an email either...
Here is a link to that PHP mail file.
So, now I am stumped and I do not know why neither file is sending me mail and I assumed its due to what the owner told me.
Do you have any ideas?
I really appreciate the help and I hope we can solve this
I realised it would help to see the contents / syntax of the two files:
This link should download the contact form's index.php (the only file of it besides the stylesheet)
This link should download the PHP mail file.
One thing I found is that you have your php tags open
IE: <? ?>
Try using <?php ?> on all your tags and see what that gives you.
hmm i hope that wasn't the problem because that would have been ridiculous and i would have felt so stupid... :lol:
And I tried it and it was not...
The links now contain the files and link to live versions of the files with the proper php tags.
the link to download your index.php file does not show <?php only <?
whoops. sorry, its there now
I uploaded your file and it sends me an email, so there is nothing wrong with your code.
well, when I tried it on a server I used to have access too, it worked even with the <? ?> PHP tags.
But on the server this and the site will go on, it does not work. And the owner of the server said it was due to the explanation above. He disabled SMTP because the ISP and I was wondering if there was a way to enable it just for me or some way I could get it to work?
no, AFAIK if SMTP is off, it's not going to send mail because mail() uses SMTP,if someone knows of a way to send mail wiyh smtp off, please let us know.