jeppers Posted April 26, 2007 Share Posted April 26, 2007 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:\test\contact.php on line 24 hoe do i enable this Link to comment https://forums.phpfreaks.com/topic/48762-solved-please-help-its-probley-somthing-simple/ Share on other sites More sharing options...
npsari Posted April 26, 2007 Share Posted April 26, 2007 I dont use SMTP server I do it normally <?php // The subject $subject = "Hi"; // The message $message = "$message"; mail($email, $subject, $message, "From: $sender"); echo "Your message has been sent."; ?> Link to comment https://forums.phpfreaks.com/topic/48762-solved-please-help-its-probley-somthing-simple/#findComment-238973 Share on other sites More sharing options...
jeppers Posted April 26, 2007 Author Share Posted April 26, 2007 well if you are using smtp what can i do to change it so it works i have changed th ini.php file and nothing has changed Link to comment https://forums.phpfreaks.com/topic/48762-solved-please-help-its-probley-somthing-simple/#findComment-239016 Share on other sites More sharing options...
Perad Posted April 26, 2007 Share Posted April 26, 2007 Is this on your webhost or on an apache server in your network or on your computer? Link to comment https://forums.phpfreaks.com/topic/48762-solved-please-help-its-probley-somthing-simple/#findComment-239029 Share on other sites More sharing options...
gazalec Posted April 26, 2007 Share Posted April 26, 2007 SMTP does not work on a localhost environment, for instance if you are using EasyPHP, you have to upload to a PHP supported server Link to comment https://forums.phpfreaks.com/topic/48762-solved-please-help-its-probley-somthing-simple/#findComment-239030 Share on other sites More sharing options...
jeppers Posted April 26, 2007 Author Share Posted April 26, 2007 localhost it is so what do i have to do to change it can u help Link to comment https://forums.phpfreaks.com/topic/48762-solved-please-help-its-probley-somthing-simple/#findComment-239032 Share on other sites More sharing options...
gazalec Posted April 26, 2007 Share Posted April 26, 2007 Yes all you have to do is upload your work onto a webhost that supports PHP, there is a good host www.freehostia.com it is free and supports PHP but i'm not sure if it supports SMTP but you can have a look around Link to comment https://forums.phpfreaks.com/topic/48762-solved-please-help-its-probley-somthing-simple/#findComment-239038 Share on other sites More sharing options...
jeppers Posted April 26, 2007 Author Share Posted April 26, 2007 i want to do it on my local machine how do i edit the code to achivie that Link to comment https://forums.phpfreaks.com/topic/48762-solved-please-help-its-probley-somthing-simple/#findComment-239040 Share on other sites More sharing options...
jeppers Posted April 26, 2007 Author Share Posted April 26, 2007 hear is my code please have a look and tell me what you think <?php include('corefuncs.php'); if (function_exists('nukemagicquotes')) { nukemagicquotes(); } // process the email if (array_key_exists('send', $_POST)) { $to = '[email protected]'; $subject = 'questions about karisma'; //process the $_post variables $name = $_post['name']; $email = $_post['email']; $comments = $_post['comments']; // build the message $message = "Name: $name\n\n"; $message .= "Email: $email\n\n"; $message .= "Comments: $comments"; // limit length to 70 caraters $message = wordwrap($message, 70); //send it $mailsent = mail($to, $subject, $message); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Japan Journey<?php if (isset($title)) {echo "—{$title}";} ?></title> <link href="journey.css" rel="stylesheet" type="text/css" media="screen" /> </head> <body> <div id="header"> <h1>Japan Journey </h1> </div> <div id="wrapper"> <?php include('menu.inc.php'); ?> <div id="maincontent"> <h1>Contact us </h1> <?php if ($_post && !$mailsent) { ?> <p class="warning">Sorry, there was a problem sending your message please try later </p> <?php } elseif ($_post && $mailsent) { ?> <p><strong>Yourmessage has been sent. Thank You</strong></p> <?php } ?> <p>Please fill in the contact infomation and ask any questing regarding karisma photography.</p> <form id="feedback" method="post" action=""> <p> <label for="name">Name:</label> <input name="name" id="name" type="text" class="formbox" /> </p> <p> <label for="email">Email:</label> <input name="email" id="email" type="text" class="formbox" /> </p> <p> <label for="comments">Comments:</label> <textarea name="comments" id="comments" cols="60" rows="8"></textarea> </p> <p> <input name="send" id="send" type="submit" value="Send message" /> </p> </form> </div> </div> </body> </html> Link to comment https://forums.phpfreaks.com/topic/48762-solved-please-help-its-probley-somthing-simple/#findComment-239053 Share on other sites More sharing options...
jeppers Posted April 26, 2007 Author Share Posted April 26, 2007 please someone help i am really stuck and i need to get this done asap if you could just give the right direction that would be good thanks Link to comment https://forums.phpfreaks.com/topic/48762-solved-please-help-its-probley-somthing-simple/#findComment-239065 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.