How to send an e-mail with PHP Programming

<>Sending a mail from php is so simple with the mail function available from php. It mainly requires three parameters ,1. to Paramater : A string representing a mail address to whom the mail has to be sent.

2. Subject Parameter : A string representing the subject of the mail.

3. Message Parameter : A string representing the actual message of the mail.

Below example code is a simple web page consisting of text fields

<?
if($_POST[submit]){ // Checks to see if the form has been submitted or not
$to = “YOUREMAIL@YOURSITE.COM“; // Your Email Address
$subject = $_POST[’subject’]; // Gets the fields from the form
$message = $_POST[’message’];
if($subject==NULL|$message==NULL) { // Checks to see if the fields are left blank and if so it display the message
die(”Sorry, but one of the fields was left blank. Please Return To The Form”);
}
$mailsend = mail($to,$subject,$message); // Puts the information into order and then sends it
{
header(”Location: ?message=Thank you”); // Redirects the page back to contact.php and then displays a message
}
}
?><form method=”POST” action=”submit.php”>
<p><label for=”fp2″>Subject:<br>
</label>
<input type=”text” name=”subject” size=”20″ id=”fp2″><br>
<label for=”fp1″>Message:<br>
</label>
<textarea rows=”6″ name=”message” cols=”16″ id=”fp1″></textarea><br>
<input type=”submit” value=”Submit” name=”submit”><input type=”reset” value=”Reset” name=”B2″></p>
</form>
<? echo $message ?>

8 Responses to “How to send an e-mail with PHP Programming”

  1. free non porn pregnancy sex photos

  2. cameron diaz naked and tyra banks too

  3. gay nude cowboys

  4. japanes free porn

  5. devil in miss jones porn

  6. gay monster anal sex

  7. filipino twinks teens cock gay 18

  8. teen gay having sex

Leave a Reply