Using PHP To Email A Form
I am wondering if I can use PHP to email the following form? And does anyone have any examples, or can anyone work with this example?
Not sure what's in those files, but you can do something like this:
Take a look at the example for more info:
$message = $_POST['postvariable1']."\n".$_POST['postvariable2'];
$message = wordwrap($message, 70);
mail('email@example.com', 'My Subject', $message);
For instance, you'll need to give it an email address to send the email from.
It's worth noting that many hosts limit the ability of the mail function by only mailing to email addresses hosted by the host (and if you can make sense of that you're a clearer thinker than my English).
That is, host xyz will only allow you to mail() to email addresses firstname.lastname@example.org hosted by host xyz.
It is worth using specialist form mailers such as the one from tectite.com as any good form mailer will also help protect your site from malicious attack.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)