pluginbaby Posted August 18, 2006 Share Posted August 18, 2006 I used this email form:[code]<?phpif (isset($_REQUEST['email']))//if "email" is filled out, send email { //send email $email = $_REQUEST['email'] ; $subject = $_REQUEST['subject'] ; $message = $_REQUEST['message'] ; mail( "someone@example.com", "Subject: $subject", $message, "From: $email" ); echo "Thank you for using our mail form"; }else//if "email" is not filled out, display the form { echo "<form method='post' action='mailform.php'> Email: <input name='email' type='text' /><br /> Subject: <input name='subject' type='text' /><br /> Message:<br /> <textarea name='message' rows='15' cols='40'> </textarea><br /> <input type='submit' /> </form>"; }?>[/code]And when I tried it on my local server I got this error:[quote]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:\Program Files\xampp\htdocs\BART2\nl\test.php on line 10[/quote]What can I do about that? Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted August 18, 2006 Share Posted August 18, 2006 look for the SMTP setting in your php.ini fileit will be set to localhost...all you need to do is set it to the smtp of your ISP and it will all work fine (he says ;)) Quote Link to comment Share on other sites More sharing options...
pluginbaby Posted August 18, 2006 Author Share Posted August 18, 2006 thank you ;DIt also says I can use this function: ini_set() How should that function be used? I mean what should be between the () ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.