954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?

E-mail form data quick and easily with PHP

0
By RamiroS on Mar 15th, 2005 4:03 am

This is one of the fastest ways to get data submitted by a HTML form, make it readable and send it by e-mail. Fast and easy. From the raw example to some basic functionality.

# To get more information about this code and some extras please visit:
# http://www.daniweb.com/techtalkforums/showthread.php?p=101880#post101880

# Create an empty message variable.
$message="";
# The mail that we want to use to recevie the submitted information.
$to="info@mydomain.com";
# The E-Mail subject
$subject="This is a message from Page X";

# iterate the $_POST array
foreach ($_POST as $key=>$value) {
    $message.=$key.": " . $value . "\n";
}

# Send message by e-mail.
$sm=mail($to, $subject, $message);

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You