#navbar { (To hide nav bar in blogger) height: 0px; visibility: hidden; display: none; }

Sunday, February 14, 2010

 

Earn Money for Reading SMS,signup for free




Thursday, February 11, 2010

 

Pear Mail module Installation Procedure for Linux

Pear module Installation Procedure for Linux
===========================

Step 1:First check whether Pear package installed or not by command 'pear'.If exists it shows the list of packages(buld,list,install,update,info,...)
To check packages installed type command - pear list


Step 2:If not,get go-pear.php file from ftp server "Kido Softs" Linux folder or http://pear.php.net/go-pear.


Step 3:Go to Command prompt & click command 'php go-pear.php'

To update your PEAR installation, request http://pear.php.net/go-pear  in your browser and save the output to a local file go-pear.php.

You can then run this command to install or update -  php go-pear.php.

Step 4:After giving command php go-pear.php,it will ask for the path where to install,give the required path (Ex:/usr/) & press Enter,the packages will get downloaded & finally if the installation is successfull ,it will ask for that you want to alter php.ini file - click on yes,that will include path in php.ini automatically.

Step 5:Install add-on packages i.e; Mail,Mail_mime,Net_SMTP by giving following commands


pear install Mail
pear install Mail_mime
pear install Net_SMTP   & if it is succesfully installed ,you will get message channel installed successfully.

Step 6:Write a sample file as below given & save it in php folder as mailsmtp.php


$current_path=ini_get("include_path");
ini_set("include_path","$current_path:/usr/PEAR:/usr/share/mime");
include("Mail.php");
include("Mail/mime.php");
//echo $current_path;
//echo ini_get("include_path");
    $message = new Mail_mime();
    $text = file_get_contents("mail_text.txt");
    $html = file_get_contents("mail_html.html");

    $message->setTXTBody($text);
    $message->setHTMLBody($html);
    $body = $message->get();
    $extraheaders = array("From"=>"raja_taraka@yahoo.co.in", "Subject"=>"My Subject 7");
    $headers = $message->headers($extraheaders);

    $mail = Mail::factory("mail");
    $mail->send("raja.marni@gmail.com", $headers, $body);


 /*   include('Mail.php');
    
$smtpinfo["host"] = "localhost";
$smtpinfo["port"] = 25;
$smtpinfo["auth"] = false;
$smtpinfo["username"] = "";
$smtpinfo["password"] = "";



    $mail = Mail::factory("smtp",$smtpinfo);
    $headers = array("From"=>"raja_taraka@yahoo.co.in", "Subject"=>"Test Mail");
    $body = "This is a test using pear mail!";
    $mail->send("raja.marni@gmail.com", $headers, $body);    */
echo "finished.....Dude!";
?>

Step 7:

finally run on browser:192.168.0.9/php/mailsmtp.php.

     
   

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]