?
Solved

not send the mail to gmail using phpmailer librarry

Posted on 2006-05-27
3
Medium Priority
?
684 Views
Last Modified: 2013-12-13
This is my PHP program:

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

$mail_to=$_POST['txtEmailto'];
//$mail_from=$_POST['txtEmailfrm'];
$mail_sub=$_POST['txtSub'];
$mail_mesg=$_POST['txtMsg'];

require("class.phpmailer.php");

$mail = new PHPMailer();

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

//gmail details

$mail->Host = 'ssl://smtp.gmail.com';
$mail->Port = 465;
$mail->SMTPAuth = true;
$mail->Username = 'sssssssss@xxxx.com';
$mail->Password = 'tttttttttt';
$mail->From     = "sssssi@ddd.com";
$mail->FromName = "ravia";
$mail->AddAddress("$mail_to","test");
$mail->WordWrap = 50;                              // set word wrap
$mail->Subject  =  $mail_sub;
//$mail->Body     =  $mail_mesg."<a href='http://in.f86.mail.yahoo.com/ym/ShowLetter?MsgId=7100_1216099_18990_1553_3682_0_1572_13727_4265448830&Idx=0&YY=29267&inc=25&order=down&sort=date&pos=0&view=a&head=b&box=Inbox'>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";

if(!$mail->Send())
{
   echo "Message was not sent <p>";
   echo "Mailer Error: " . $mail->ErrorInfo;
   exit;
}

echo "Message has been sent";

Mail is not send this code plese help me

My Error is:

[client 127.0.0.1] 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
0
Comment
Question by:anumularavi
1 Comment
 
LVL 40

Accepted Solution

by:
Richard Quadling earned 200 total points
ID: 16787903
Instead  of ...

$mail->Host = 'ssl://smtp.gmail.com';

can you try ...

$mail->Host = 'smtp.gmail.com';


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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
This article discusses how to create an extensible mechanism for linked drop downs.
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.
Suggested Courses

621 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