Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10

Thread: Contact form

  1. #1
    New Coder
    Join Date
    Feb 2009
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 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
    Master Coder mlseim's Avatar
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,387
    Thanks
    8
    Thanked 1,077 Times in 1,068 Posts
    Who is the webhost ....

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


    .

  • #3
    New Coder
    Join Date
    Feb 2009
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes, thats what I meant.

  • #4
    Master Coder mlseim's Avatar
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,387
    Thanks
    8
    Thanked 1,077 Times in 1,068 Posts
    Who is your webhost?

    .

  • #5
    New Coder
    Join Date
    Feb 2009
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by mlseim View Post
    Who is your webhost?

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

  • #6
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,091
    Thanks
    51
    Thanked 506 Times in 493 Posts
    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; 09-01-2011 at 09:20 PM.
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!

  • #7
    New Coder
    Join Date
    Feb 2009
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote 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.

  • #8
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,091
    Thanks
    51
    Thanked 506 Times in 493 Posts
    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.
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!

  • #9
    New Coder
    Join Date
    Feb 2009
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts
    So, UniformServer might give me a possible solution right? I've never used it before, I've used XAMPP.

  • #10
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,091
    Thanks
    51
    Thanked 506 Times in 493 Posts
    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.
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!


  •  

    Posting Permissions

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