H I O X INDIA
FREE PHP Topics
Google
Web hscripts.com
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Directories 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)   Bookmarks :-)  
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

PHP Topics
Introduction
Common Header
Random Number
Type
Form Variables
Date and Time
File Handling
Error Handling
DB Size
PHP Mail
String Tokens
Running PHP from JS
Array To JS
Array to PHP
Encryption
Ask Your Doubts
Feedback





PHP Mailing


Topic

How can I use php to send mail?



Explanation

Follow the steps to do it yourself


Step 1:

Its realy simple to send mail using php.
First define the parameters to,suject,message and header containing from and reply address
<?php
$to = "toaddress@mailservername.com";
$subject = "Just a test mail";
$message = "Just training on php";
$from = "fromaddress@mailservername.com";

//Header is the portinn where we will set the from address, reply to address, cc address, etc....
//The display of address we see on the top (from,to,replyto) portion of the composer will be based on the header we set

/* To send HTML mail, you can set the Content-type header. */
$headers1 = "MIME-Version: 1.0\r\n";
$headers1 .= "Content-type: text/html; charset=iso-8859-1\r\n";

/* additional headers */
$headers1 .= "To: ".$to."\r\n";
$headers1 .= "From: ".$from."\r\n";
$headers1 .= "Reply-To: ".$from."\r\n";
?>


Step 2:

Now we send the mail using php api
<?php
mail($to, $subject, $message, $headers);
?>





others


privacypolicy     licence     sitemap
(c) copyright, 2004 hioxindia.com