...

View Full Version : Contact form



saxchick1
09-01-2011, 04:43 AM
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.

mlseim
09-01-2011, 03:09 PM
Who is the webhost ....

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


.

saxchick1
09-01-2011, 07:09 PM
Yes, thats what I meant.

mlseim
09-01-2011, 08:50 PM
Who is your webhost?

.

saxchick1
09-01-2011, 09:15 PM
Who is your webhost?

.

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

tangoforce
09-01-2011, 10:16 PM
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.

saxchick1
09-01-2011, 10:45 PM
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.

tangoforce
09-01-2011, 10:57 PM
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.

saxchick1
09-02-2011, 01:51 AM
So, UniformServer might give me a possible solution right? I've never used it before, I've used XAMPP.

tangoforce
09-02-2011, 02:03 AM
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 :thumbsup:

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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum