I was asked to include the full phpmailer file and the source code of
SmtpConnect(). Easy enough, here you go. Good luck.
function SmtpConnect() {
if($this->smtp == NULL) { $this->smtp = new SMTP(); }
//$this->smtp->do_debug = $this->SMTPDebug;
$hosts = explode(";", $this->Host);
$index = 0;
$connection = ($this->smtp->Connected());
// Retry while there is no connection
while($index < count($hosts) && $connection == false)
{
if(strstr($hosts[$index], ":"))
{
$hostA = explode(':', $hosts[$index]);
if (is_numeric(end($hostA)))
$port = array_pop($hostA);
else
$port = $this->Port;
$host = implode(':', $hostA);
}
else
{
$host = $hosts[$index];
$port = $this->Port;
}
if($this->smtp->Connect($host, $port, $this->Timeout))
{
if ($this->Helo != '')
$this->smtp->Hello($this->Helo);
else
$this->smtp->Hello($this->ServerHostname());
if($this->SMTPAuth)
{
if(!$this->smtp->Authenticate($this->Username,
$this->Password))
{
$this->SetError($this->Lang("authenticate"));
$this->smtp->Reset();
$connection = false;
}
}
$connection = true;
}
$index++;
}
if(!$connection)
{
$this->SetError($this->Lang("connect_host"));
}
return $connection;
}
Jon Crawford wrote:
>
> I was able to get both inbound and outbound mail to work. I am running on
> Apache2 w/ PHP 5.0 and OpenSSL and eGroupware 1.4.004.
>
> Incoming IMAP
> hostname: imap.gmail.com
> port: 993
> username: username@...
> password: password
> encrypted connection: SSL
> Do not validate certificate: checked
> server supports mailfilter(sieve): checked
> port: 2000
>
> Outgoing
> hostname: ssl://smtp.gmail.com
> port: 465
> authentication required: checked
> username: username@...
> password: password
>
>
> In order to make outgoing mail work I had to edit the
> /phpgwapi/inc/class.phpmailer.inc.php file
> For details search google for gMail phpmailer
>
> Basically, under the function SmtpConnect() there is a section right
> before this line
> if($this->smtp->Connect($host, $port, $this->Timeout));
>
> I don't have what the code looked like before but I changed it to:
>
> if(strstr($hosts[$index], ":"))
> {
> $hostA = explode(':', $hosts[$index]);
> if (is_numeric(end($hostA)))
> $port = array_pop($hostA);
> else
> $port = $this->Port;
> $host = implode(':', $hostA);
> }
> else
> {
> $host = $hosts[$index];
> $port = $this->Port;
> }
>
>
>
>
> matsie wrote:
>>
>> Is there anybody who managed to retrieve and send email via his/her gmail
>> account within egroupware?
>>
>> If so, then I kindly ask you to post the full specifics as well as the
>> necessary program dependencies if any.
>>
>> Thanks in advance.
>>
>> P.D. Although I followed the instructions above, it did not work. I was
>> constantly asked to save index.php.
>>
>
>
http://www.nabble.com/file/p18203780/class.phpmailer.inc.php
class.phpmailer.inc.php
--
View this message in context: http://www.nabble.com/GMail-IMAP-tp13502514s3741p18203780.html
Sent from the egroupware-users mailing list archive at Nabble.com.
|