team1504 — 2011-11-01T15:21:58-04:00 — #1
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,
ralphm — 2011-11-01T20:25:05-04:00 — #2
I could be wrong, but I wouldn't think that this affects the operation of a PHP form. How have you set it up?
team1504 — 2011-11-03T13:54:54-04:00 — #3
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.
gman — 2011-11-03T18:38:38-04:00 — #4
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.
team1504 — 2011-11-04T14:18:48-04:00 — #5
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.
gman — 2011-11-04T14:38:43-04:00 — #6
the link to download your index.php file does not show <?php only <?
team1504 — 2011-11-04T16:07:10-04:00 — #7
whoops. sorry, its there now
gman — 2011-11-04T18:47:20-04:00 — #8
I uploaded your file and it sends me an email, so there is nothing wrong with your code.
team1504 — 2011-11-04T18:55:23-04:00 — #9
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?
gman — 2011-11-04T22:57:49-04:00 — #10
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.