/    Sign up×
Community /Pin to ProfileBookmark

PHP beginner – trying to test contact form

I’ve just started using PHP and I’m working on the script for a contact form. I.e. someone fills in details on my website and when they click ‘submit’ I receive an e-mail with their details and comments.

The problem:
I’m working on localhost (XXAMP) and when the mail is supposed to out I get the following message:

[COLOR=”DimGray”]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 C:xampphtdocs_contactcontactsave.php on line 16[/COLOR]

[B]How can I change the settings so that the e-mail is sent and I can test my form properly?[/B]

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@MindzaiSep 11.2009 — Do you have a mail server installed on the machine?
Copy linkTweet thisAlerts:
@XAmsterdamXauthorSep 11.2009 — I was hoping that was included in XXAMP - I'm guessing now that it isn't.

What is a good open-source mailserver?
Copy linkTweet thisAlerts:
@westconn1Sep 14.2009 — or move the script to web server
Copy linkTweet thisAlerts:
@NogDogSep 14.2009 — I normally use [url=http://phpmailer.worxware.com/]PHPMailer[/url] for my PHP email tasks. It comes with its own SMTP class which allows you to send the emails via whatever SMTP mail server you have access to (such as your ISP provider). This way you can test your app locally by using SMTP, then on the live server version change a couple config settings to send via mail(), or even by directly calling sendmail on a UNIX/Linus host.
×

Success!

Help @XAmsterdamX spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...