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( "[email protected]", "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? Link to comment https://forums.phpfreaks.com/topic/17930-php-email-form/ 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 ;)) Link to comment https://forums.phpfreaks.com/topic/17930-php-email-form/#findComment-76687 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 () ? Link to comment https://forums.phpfreaks.com/topic/17930-php-email-form/#findComment-76690 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.