Web Analytics Made Easy -
StatCounter Contact form - CodingForum

Announcement

Collapse
No announcement yet.

Contact form

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Contact form

    I've been going about this for a few days and still not getting my end result. I am trying to make a contact form for a client of mine, and the host they are using doesnt allow the phpmail (), but they do allow php 5. I've asked around in a few places and others have suggested to me that I use a phpmailer or a phpmailer class. Is there a template or an example of something that I could as an alternate to have a fully functional form that also works with gmail.

  • #2
    Who is the webhost ....

    and do you really mean this function ... mail() ?


    .

    Comment


    • #3
      Yes, thats what I meant.

      Comment


      • #4
        Who is your webhost?

        .

        Comment


        • #5
          Originally posted by mlseim View Post
          Who is your webhost?

          .
          Mezoka (I am using the free plan for now and I have a subdomain).

          Comment


          • #6
            Free hosts that offer PHP usually disable mail() to stop abuse of their service by spammers. They also usually turn off any function which can be used to connect to an external server (EG smtp access).

            Your best bet would be to download a WAMP package such as XAMPP or UniformServer these have everything you need (Apache, MySQL & PHP) to experiment/host your website on your own PC which speeds up the learning process a lot. Both of these have a sendmail equivalent program which you can then use to connect to a SMTP server and send email using the default mail() function. I personally recommend uniformserver as its smaller and easier to move around whereas XAMPP is over 100Mb.
            Last edited by tangoforce; Sep 1, 2011, 05:20 PM.
            "Tango says double quotes with a single ( ' ) quote in the middle"
            '$Name says single quotes with a double ( " ) quote in the middle'
            "Tango says double quotes ( \" ) must escape a double quote"
            '$Name single quotes ( \' ) must escape a single quote'

            Comment


            • #7
              Originally posted by tangoforce View Post
              Free hosts that offer PHP usually disable mail() to stop abuse of their service by spammers. They also usually turn off any function which can be used to connect to an external server (EG smtp access).

              Your best bet would be to download a WAMP package such as XAMPP or UniformServer these have everything you need (Apache, MySQL & PHP) to experiment/host your website on your own PC which speeds up the learning process a lot. Both of these have a sendmail equivalent program which you can then use to connect to a SMTP server and send email using the default mail() function. I personally recommend uniformserver as its smaller and easier to move around whereas XAMPP is over 100Mb.
              Thats exactly what my webhost did. I've heard about a php mailer class being a good alternate, but my knowledge of php is very little and the only way I know how to send emails is by using the mail function.

              Comment


              • #8
                The mailer class will make no difference as I've stated above. If the host has turned off the Fopen Wrappers then it will simply fail to work as it will not connect to an external system.

                Basically ANY external calls from php require Fopen wrappers to be turned on. If its off you have no chance of connecting to an external SMTP server. There is no workaround for this other than to download a WAMP package as I've already suggested.

                What you need to remember is that systems administrators are a step ahead of learner programmers - everything you think of trying they've already blocked in case you're a spammer.
                "Tango says double quotes with a single ( ' ) quote in the middle"
                '$Name says single quotes with a double ( " ) quote in the middle'
                "Tango says double quotes ( \" ) must escape a double quote"
                '$Name single quotes ( \' ) must escape a single quote'

                Comment


                • #9
                  So, UniformServer might give me a possible solution right? I've never used it before, I've used XAMPP.

                  Comment


                  • #10
                    IF you have xampp stick with that. It has a program called fakesendmail (i think.. might be a different one - been a while). Open the config file for that and set it up to your gmail account. You can then run php code using your xampp server like you would a normal host. Just write your php code which uses mail() and mail() will then call the external program which will connect to gmail and send your email

                    You can use uniformserver if you want, it does the same thing but takes less diskspace. Only reason I'm suggesting you stay with xampp is to save yourself another download.
                    "Tango says double quotes with a single ( ' ) quote in the middle"
                    '$Name says single quotes with a double ( " ) quote in the middle'
                    "Tango says double quotes ( \" ) must escape a double quote"
                    '$Name single quotes ( \' ) must escape a single quote'

                    Comment

                    Working...
                    X