PHP Questions Home

Categories

Arrays
Files
Forms
Functions
Images
MySQL
Numbers
Others
Strings
Website


PHP Functions

PHP Functions


More PHP

Top Questions
Ask a Question

How do I email the contents of a form to me?


The mail function is used to send email in PHP. People are amazed how easy it is to send a simple email with PHP and think there must be a catch or a complicated method, but in fact it's really simple.

The mail function can take several parameters, however for a simple email all you need are the first three - who it is to, the title of the email (subject) and the contents of the message (body).

Thus if your web server is configured to allow use of the mail function on PHP, this will send an email:

<?php
mail
("me@myaddress.com","Hello me","That was easy wasn't it?");
?>



More forms PHP Questions

How can I check a value entered in a field on my form is a number?
How can I check that a data value is alphanumeric?
How can I access information sent through GET on a form?
How do I remove escape characters from data?
How do I check that a valid email address is entered?