not send the mail to gmail using phpmailer librarry

Posted on 2006-05-27
Last Modified: 2013-12-13
This is my PHP program:

ini_set("include_path", "../phpmailer");



$mail = new PHPMailer();

$mail->IsSMTP();                                   // send via SMTP
//$mail->Host     = ""; // SMTP servers
//$mail->SMTPAuth = true;     // turn on SMTP authentication

//gmail details

$mail->Host = 'ssl://';
$mail->Port = 465;
$mail->SMTPAuth = true;
$mail->Username = '';
$mail->Password = 'tttttttttt';
$mail->From     = "";
$mail->FromName = "ravia";
$mail->WordWrap = 50;                              // set word wrap
$mail->Subject  =  $mail_sub;
//$mail->Body     =  $mail_mesg."<a href=''>this</a>";
$mail->Body     =  $mail_mesg;
//$mail->Body     =  $mail_mesg."<img src=http://localhost/hyd/display_property_images/display_images.php?property_id=1050609143959>";
$mail->AltBody  =  "This is the text-only body";

   echo "Message was not sent <p>";
   echo "Mailer Error: " . $mail->ErrorInfo;

echo "Message has been sent";

Mail is not send this code plese help me

My Error is:

[client] PHP Warning:  fsockopen() expects parameter 2 to be long, string given in C:\\Program Files\\Apache Group\\Apache2\\htdocs\\hyd\\ravi_test\\phpmailer\\class.smtp.php on line 105, referer: http://localhost/hyd/ravi_test/mail/email.php
plese help me sir
Question by:anumularavi
    1 Comment
    LVL 40

    Accepted Solution

    Instead  of ...

    $mail->Host = 'ssl://';

    can you try ...

    $mail->Host = '';

    The protocol is not part of the host. That is defined by the port and SMTPAuth.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
    Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now