SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Guru team1504's Avatar
    Join Date
    May 2010
    Location
    Okemos, Michigan, USA
    Posts
    732
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Question Help with PHP contact form not sending

    Hello,
    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?
    Or
    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,
    Team 1504

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,598
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    I could be wrong, but I wouldn't think that this affects the operation of a PHP form. How have you set it up?

  3. #3
    SitePoint Guru team1504's Avatar
    Join Date
    May 2010
    Location
    Okemos, Michigan, USA
    Posts
    732
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hello,
    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

    Regards,
    Team 1504

    P.S.
    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)
    and
    This link should download the PHP mail file.

  4. #4
    SitePoint Zealot Gman's Avatar
    Join Date
    Jan 2002
    Location
    Sarasota, FL
    Posts
    154
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  5. #5
    SitePoint Guru team1504's Avatar
    Join Date
    May 2010
    Location
    Okemos, Michigan, USA
    Posts
    732
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    hmm i hope that wasn't the problem because that would have been ridiculous and i would have felt so stupid...

    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.

  6. #6
    SitePoint Zealot Gman's Avatar
    Join Date
    Jan 2002
    Location
    Sarasota, FL
    Posts
    154
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the link to download your index.php file does not show <?php only <?

  7. #7
    SitePoint Guru team1504's Avatar
    Join Date
    May 2010
    Location
    Okemos, Michigan, USA
    Posts
    732
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    whoops. sorry, its there now

  8. #8
    SitePoint Zealot Gman's Avatar
    Join Date
    Jan 2002
    Location
    Sarasota, FL
    Posts
    154
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I uploaded your file and it sends me an email, so there is nothing wrong with your code.

  9. #9
    SitePoint Guru team1504's Avatar
    Join Date
    May 2010
    Location
    Okemos, Michigan, USA
    Posts
    732
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    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?

    Regards,
    Team 1504

  10. #10
    SitePoint Zealot Gman's Avatar
    Join Date
    Jan 2002
    Location
    Sarasota, FL
    Posts
    154
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •