I am beginner of php. And i know very little about it. I already create a form in dreamweaver. When i fill in the form, by click the submit button, the form data will email to the particular people. Can it be done??? Anybody can help? Can explain more or state clearly the step so that i can understand. Thanks.
if you're email form is like this: <form action="send.php" method="post"> Your email: <input type="text" name="email" /> <br/> Your message: <textarea name="message"></texarea> <br/> <input type="submit" name="submit" /> </form> Code (markup): send.php should look like this: if (isset($_POST['submit'])) { $message= $_POST['message']; $email = $_POST['email']; $recipients = 'your@email.com'; $subject = "Website Enquiry"; $body = ''; $body .= '<strong>E-Mail:</strong> ' . $email . '<br />'; $body .= $message; if ( mail($recipients,$subject,$body) ) { echo 'Your message has been sent successfully.'; } else { echo '<h1 class="error">Your email has not been sent. Please try again.</h1>'; } } PHP:
You may also try http://sourceforge.net/projects/phpmailer/ if you like to work with HTML type of emails or adding attachments.
i use the method : $headers = 'MIME-Version:1.0'."\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1'."\r\n"; $headers .= 'From: '."\r\n"; mail($to, $subject, $message, $headers); but if got Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 <mylooieva@gmail.com>... Relaying denied. IP name possibly forged [115.135.59.70] in C:\xampp\htdocs\ischeduling\ict_code.php on line 30 Anybody know how to solve this problem?
550 - The requested command failed because the user's mailbox was unavailable (for example because it was not found, or because the command was rejected for policy reasons).