Sending an e-mail
Posted: Tue Jul 07, 2009 3:38 am
I've got this coded:
I this I'm trying to make it send an e-mail to me, "myemail@gmail.com" with the texts inputed in forms for input1 and input2. These two are meant to be submitted into the e-mail-sending PHP code after clicking the submit.jpg image. However, this doesn't seem to work.
The e-mail should look like this:
Subject: input1 -- input2
Message: input1
input2
Can anyone help??
Code: Select all
<html>
<head>
<?php
$to = 'myemail@gmail.com';
$subject = '$input1' . ' -- ' . '$input2';
$message = '$input1<br />$input2';
if (mail($to, $subject, $message))
{
print 'Mail sent.';
}
?>
</head>
<body>
<form><span class="vertwenty"><img src="input1.jpg" /> </span><input class="forem" type="text" name="input1" /></form>
<form><span class="vertwenty"><img src="input2.jpg" /> </span><input class="forem" type="text" name="input2" /></form>
<br />
<br /><form><input type="image" src="submit.jpg" alt="Submit"></form>
</body>
</html>The e-mail should look like this:
Subject: input1 -- input2
Message: input1
input2
Can anyone help??