How to create socket connection with php?

Cant send mail through php using the pear package.Please help. Its very very urgent?

  • i am using cpanel 11 i have these pear packages installed on my web host Auth_SASL 1.0.2 Mail 1.1.14 Mail_Mime 1.5.2 Mail_Queue 1.2.2 Mail_mimeDecode 1.5.0 Net_SMTP 1.3.2 Net_Socket 1.0.9 Net_URL 1.0.15 i have an note in php pear section of my cpanel 11like this " PEAR packages are collections of functions that allow you to perform tasks in PHP. You will need to install Location of Your PHP Extension(s) and Application(s) Path: /home/thedarke/php Using Your PHP Extension(s) and Application(s) You will need to add /home/thedarke/php to the include path. You can do this by adding the following code to your script: ini_set("include_path", '/home/thedarke/php:' . ini_get("include_path") ); " my php code is as follows <?php include("Mail.php"); /* mail setup recipients, subject etc */ $recipients = "[email protected]"; $headers["From"] = "[email protected]"; $headers["To"] = "[email protected]"; $headers["Subject"] = "User feedback"; $mailmsg = "Hello, This is a test."; /* SMTP server name, port, user/passwd */ $smtpinfo["host"] = "my smtp mail address"; $smtpinfo["port"] = "25"; $smtpinfo["auth"] = true; $smtpinfo["username"] = "smtp username"; $smtpinfo["password"] = "smtp password"; /* Create the mail object using the Mail::factory method */ $mail_object =& Mail::factory("smtp", $smtpinfo); /* Ok send mail */ $mail_object->send($recipients, $headers, $mailmsg); ?> i am getting error, it sometimes says connection timeout please please help meee. b quick

  • Answer:

    Your code is correct, may be there is something wrong with your pear installation. Follow these steps to install it back again.(Can you use any other pear packages?) http://www.sematopia.com/?p=28

kapeel at Yahoo! Answers Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.