trex2002ro Posted July 19, 2007 Share Posted July 19, 2007 I need some help with an script // send message if($_POST[submit]) { // check for suspected injection strings foreach($_POST as $name => $value) { filter_string($value); } // check for unexpected newline characters foreach($_POST as $name => $value) { if($name != 'message') filter_string($value); } $_POST = safe_data($_POST, 'display'); // check for required information if(!$_POST[name]) $error .= 'The <strong>Name</strong> field was left blank.<br/>'; if(!check_email($_POST[email])) $error .= 'The <strong>Email Address</strong> you entered appears to be invalid.<br/>'; if(!$_POST[subject]) $error .= 'The <strong>Subject</strong> field was left blank.<br/>'; if(!$_POST[message]) $error .= 'The <strong>Message</strong> field was left blank.<br/>'; // send message if no errors have occurred if(!$error) { $message = "Sent: ".date($conf[dformat].' '.$conf[tformat], time()+(3600*$conf[toffset]))." Name: $_POST[name] Email: $_POST[email] Phone: $_POST[phone] Best time to reach me: $_POST[contact] $_POST[message]"; // remove any punctuation from name to prevent email errors $_POST[name] = ereg_replace("[[:punct:]]", " ", $_POST[name]); mail($sendto, $_POST[subject], $message, "From:$_POST[name] <$_POST[email]>"); $sent = true; I need to send the message using external SMTP. I don't have acces to php.ini or web server's settings Thanks Quote Link to comment Share on other sites More sharing options...
jitesh Posted July 19, 2007 Share Posted July 19, 2007 Download and use php mailer Google : php mailer Quote Link to comment Share on other sites More sharing options...
vbnullchar Posted July 19, 2007 Share Posted July 19, 2007 i dont know if this would work in window$ ini_set(SMTP,$smtp_server"); ini_set(smtp_port,$smtp_port); 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.