Jump to content

Contact Form Mailing


anton_1

Recommended Posts

Im having bother setting up a contact form. how easily can this be done.

 

How do I set up my mail server, any tips and hints?

 

Any help would be appreciated.

 

 

 

What I'm working on just now:

 

Error Message - Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs\mail\processmail.php on line 12

 

 

<html>

<body>

 

<form method="POST" action="processmail.php">

  <input type="text" name="name" size="19"><br>

  <br>

  <input type="text" name="email" size="19"><br>

  <br>

  <textarea rows="9" name="message" cols="30"></textarea>

  <br>

  <br>

  <input type="submit" value="Submit" name="submit">

</form>

 

</body>

</html>

 

 

 

<?php

if(isset($_POST['submit'])) {

$to = "08006925@live.napier.ac.uk";

$subject = "Form Tutorial";

$name_field = $_POST['name'];

$email_field = $_POST['email'];

$message = $_POST['message'];

 

$body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message";

 

echo "Data has been submitted to $to!";

mail($to, $subject, $body);

} else {

echo "blarg!";

}

?>

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.