php Contact Form Problem

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
TomBullock
-


Joined: 30 Jun 2007
Posts: 76

PostPosted: Wed Aug 29, 2007 3:14 pm    Post subject: php Contact Form Problem Reply with quote

Hello.
I am designing a new site and instead of just putting mailto:you@domain.com im using php.

I have most of it complete but when i test it, i get this error after i submit.
Code:
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in D:\Website\New\sendeail.php on line 144


Can anyone tell me whats wrong?
I amuse its something to do with STMP server?

Thankyou
Back to top View user's profile Send private message
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Wed Aug 29, 2007 5:23 pm    Post subject: Reply with quote

Its exactly what it says it is. Your script failed to connect to a mail server because you're not running one on localhost. Either set one up for outgoing mail or set your php.ini to use your ISP's smtp server.

A quick google search would have solved this problem. You should review forum rules 1 and 2.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
TomBullock
-


Joined: 30 Jun 2007
Posts: 76

PostPosted: Wed Aug 29, 2007 5:28 pm    Post subject: Reply with quote

To run one on localhost would i just download a SMTP server of www.download.com or something?
Back to top View user's profile Send private message
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Wed Aug 29, 2007 5:30 pm    Post subject: Reply with quote

TomBullock wrote:
To run one on localhost would i just download a SMTP server of www.download.com or something?


Yes but you may find you still have to use your ISPs mail server because your IP will most likely be black listed and be banned from sending email.

www.hmailserver.com very easy to set up.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
TomBullock
-


Joined: 30 Jun 2007
Posts: 76

PostPosted: Wed Aug 29, 2007 5:41 pm    Post subject: Reply with quote

Ok i see.
Ive tried to forward port 25, but when i press apply it says 'Invalid Port Number'
How can i get port 25 into range?
Back to top View user's profile Send private message
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Wed Aug 29, 2007 5:44 pm    Post subject: Reply with quote

TomBullock wrote:
Ok i see.
Ive tried to forward port 25, but when i press apply it says 'Invalid Port Number'
How can i get port 25 into range?


Check its not banned in your routers config or that its not already forwarded. You shouldn't need to forward 25 for outgoing mail anyway. Since its outgoing, not incoming.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
TomBullock
-


Joined: 30 Jun 2007
Posts: 76

PostPosted: Wed Aug 29, 2007 8:16 pm    Post subject: Reply with quote

I download hMailServer as you suggested and entered the following info:


    Domains > My hotmail account.
    Settings > Protocols > SMTP > Deliveries of e-mail > SMTP Relayer = smtp.virgin.net
    Settings > Advanced > My Computer > Enabled 'External to external accounts'


When i tested the contact form again, i got no error codes.
But the email never came through?

Thanks
Back to top View user's profile Send private message
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Thu Aug 30, 2007 8:09 am    Post subject: Reply with quote

You cannot host your own hotmail account because you do not own the domain hotmail.com. You can only host e-mail for domains you own. If you don't own a domain it would be email@123.123.123.123. You can use a dyndns/no-ip domain if you have one.

Anything you send from the server will always get sent but any incomming mail will probably be stopped due to spam filters on the dns servers etc. Its virtually impossible to host a 100% reliable mail server from broadband. I had the same issue.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
pkSML
-


Joined: 29 May 2006
Posts: 952
Location: Michigan, USA

PostPosted: Fri Aug 31, 2007 5:26 am    Post subject: Reply with quote

Tom, you can send email on behalf of a Gmail account for a PHP contact form.

If you sign up for a gmail account, you can have the contact form submissions be directed to your hotmail account.

See http://stephen.calvarybucyrus.org/redirect.php?page=gmail_php

Change the $send_to variable in sendmail.php to this:
Code:
$send_to = "tombenbullock@hotmail.com"; // deliver correspondence to this address

_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group