@@ -2,7 +2,7 @@
|
||||
/*
|
||||
* smtp.php
|
||||
*
|
||||
* @(#) $Header: /opt2/ena/metal/smtp/smtp.php,v 1.51 2016/08/23 04:55:14 mlemos Exp $
|
||||
* @(#) $Header: /opt2/ena/metal/smtp/smtp.php,v 1.52 2020/01/13 06:22:23 mlemos Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
<package>net.manuellemos.smtp</package>
|
||||
|
||||
<version>@(#) $Id: smtp.php,v 1.51 2016/08/23 04:55:14 mlemos Exp $</version>
|
||||
<version>@(#) $Id: smtp.php,v 1.52 2020/01/13 06:22:23 mlemos Exp $</version>
|
||||
<copyright>Copyright (C) Manuel Lemos 1999-2011</copyright>
|
||||
<title>Sending e-mail messages via SMTP protocol</title>
|
||||
<author>Manuel Lemos</author>
|
||||
@@ -123,6 +123,24 @@ class smtp_class
|
||||
*/
|
||||
var $workstation="";
|
||||
|
||||
/*
|
||||
{metadocument}
|
||||
<variable>
|
||||
<name>token</name>
|
||||
<type>STRING</type>
|
||||
<value></value>
|
||||
<documentation>
|
||||
<purpose>Define the authentication token when sending messages
|
||||
to a SMTP server.</purpose>
|
||||
<usage>Set this variable to the token value when the SMTP
|
||||
server requires authentication to pass an authorization
|
||||
token.</usage>
|
||||
</documentation>
|
||||
</variable>
|
||||
{/metadocument}
|
||||
*/
|
||||
var $token="";
|
||||
|
||||
/*
|
||||
{metadocument}
|
||||
<variable>
|
||||
@@ -280,7 +298,7 @@ class smtp_class
|
||||
<variable>
|
||||
<name>user_agent</name>
|
||||
<type>STRING</type>
|
||||
<value>SMTP Class (http://www.phpclasses.org/smtpclass $Revision: 1.51 $)</value>
|
||||
<value>SMTP Class (http://www.phpclasses.org/smtpclass $Revision: 1.52 $)</value>
|
||||
<documentation>
|
||||
<purpose>Set the user agent used when connecting via an HTTP proxy.</purpose>
|
||||
<usage>Change this value only if for some reason you want emulate a
|
||||
@@ -289,7 +307,7 @@ class smtp_class
|
||||
</variable>
|
||||
{/metadocument}
|
||||
*/
|
||||
var $user_agent='SMTP Class (http://www.phpclasses.org/smtpclass $Revision: 1.51 $)';
|
||||
var $user_agent='SMTP Class (http://www.phpclasses.org/smtpclass $Revision: 1.52 $)';
|
||||
|
||||
/*
|
||||
{metadocument}
|
||||
@@ -1004,6 +1022,8 @@ class smtp_class
|
||||
$sasl->SetCredential("workstation",$credentials["workstation"]);
|
||||
if(IsSet($credentials["mode"]))
|
||||
$sasl->SetCredential("mode",$credentials["mode"]);
|
||||
if(IsSet($credentials["token"]))
|
||||
$sasl->SetCredential("token",$credentials["token"]);
|
||||
do
|
||||
{
|
||||
$status=$sasl->Start($mechanisms,$message,$interactions);
|
||||
@@ -1320,12 +1340,14 @@ class smtp_class
|
||||
}
|
||||
$credentials=array(
|
||||
"user"=>$this->user,
|
||||
"password"=>$this->password
|
||||
"password"=>$this->password,
|
||||
);
|
||||
if(strlen($this->realm))
|
||||
$credentials["realm"]=$this->realm;
|
||||
if(strlen($this->workstation))
|
||||
$credentials["workstation"]=$this->workstation;
|
||||
if(strlen($this->token))
|
||||
$credentials["token"]=$this->token;
|
||||
$success=$this->SASLAuthenticate($mechanisms,$credentials,$authenticated,$mechanism);
|
||||
if(!$success
|
||||
&& !strcmp($mechanism,"PLAIN"))
|
||||
|
||||
Reference in New Issue
Block a user