dolibarr  7.0.0-beta
Public Member Functions | Public Attributes | List of all members
SMTPs Class Reference

Class to construct and send SMTP compliant email, even to a secure SMTP server, regardless of platform. More...

Public Member Functions

 setDeliveryReceipt ($_val=0)
 Set delivery receipt. More...
 
 getDeliveryReceipt ()
 get delivery receipt More...
 
 setTrackId ($_val= '')
 Set trackid. More...
 
 setMoreInHeader ($_val= '')
 Set moreInHeader. More...
 
 getTrackId ()
 get trackid More...
 
 getMoreInHeader ()
 get moreInHeader More...
 
 setErrorsTo ($_strErrorsTo)
 Set errors to. More...
 
 getErrorsTo ($_part=true)
 Get errors to. More...
 
 setDebug ($_vDebug=false)
 Set debug. More...
 
 buildRCPTlist ()
 build RECIPIENT List, all addresses who will recieve this message More...
 
 _server_connect ()
 Attempt a connection to mail server. More...
 
 _server_authenticate ()
 Attempt mail server authentication for a secure connection. More...
 
 sendMsg ($_bolTestMsg=false, $_bolDebug=false)
 Now send the message. More...
 
 setConfig ($_strConfigPath=null)
 setConfig() is used to populate select class properties from either a user defined INI file or the systems 'php.ini' file More...
 
 setTransportType ($_type=0)
 Determines the method inwhich the messages are to be sent. More...
 
 getTransportType ()
 Return the method inwhich the message is to be sent. More...
 
 setMailPath ($_path)
 Path to the sendmail execuable. More...
 
 setHost ($_strHost)
 Defines the Host Name or IP of the Mail Server to use. More...
 
 getHost ()
 Retrieves the Host Name or IP of the Mail Server to use This is used only with 'socket' based mail transmission. More...
 
 setPort ($_intPort)
 Defines the Port Number of the Mail Server to use This is defaulted to '25' This is used only with 'socket' based mail transmission. More...
 
 getPort ()
 Retrieves the Port Number of the Mail Server to use This is used only with 'socket' based mail transmission. More...
 
 setID ($_strID)
 User Name for authentication on Mail Server. More...
 
 getID ()
 Retrieves the User Name for authentication on Mail Server. More...
 
 setPW ($_strPW)
 User Password for authentication on Mail Server. More...
 
 getPW ()
 Retrieves the User Password for authentication on Mail Server. More...
 
 setCharSet ($_strCharSet)
 Character set used for current message Character set is defaulted to 'iso-8859-1';. More...
 
 getCharSet ()
 Retrieves the Character set used for current message. More...
 
 setTransEncode ($_strTransEncode)
 Content-Transfer-Encoding, Defaulted to '7bit' This can be changed for 2byte characers sets Known Encode Types. More...
 
 getTransEncode ()
 Retrieves the Content-Transfer-Encoding. More...
 
 setTransEncodeType ($_strTransEncodeType)
 Content-Transfer-Encoding, Defaulted to '0' [ZERO] This can be changed for 2byte characers sets Known Encode Types. More...
 
 getTransEncodeType ()
 Retrieves the Content-Transfer-Encoding. More...
 
 setFrom ($_strFrom)
 FROM Address from which mail will be sent. More...
 
 getFrom ($_part=true)
 Retrieves the Address from which mail will be sent. More...
 
 setReplyTo ($_strReplyTo)
 Reply-To Address from which mail will be the reply-to. More...
 
 getReplyTo ($_part=true)
 Retrieves the Address from which mail will be the reply-to. More...
 
 _buildAddrList ($_type, $_addrList)
 Inserts given addresses into structured format. More...
 
 _strip_email ($_strAddr)
 Returns an array of the various parts of an email address This assumes a well formed address: More...
 
 get_RCPT_list ()
 Returns an array of bares addresses for use with 'RCPT TO:' This is a "build as you go" method. More...
 
 get_email_list ($_which=null)
 Returns an array of addresses for a specific type; TO, CC or BCC. More...
 
 setTO ($_addrTo)
 TO Address[es] inwhich to send mail to. More...
 
 getTo ()
 Retrieves the TO Address[es] inwhich to send mail to. More...
 
 setCC ($_strCC)
 CC Address[es] inwhich to send mail to. More...
 
 getCC ()
 Retrieves the CC Address[es] inwhich to send mail to. More...
 
 setBCC ($_strBCC)
 BCC Address[es] inwhich to send mail to. More...
 
 getBCC ()
 Retrieves the BCC Address[es] inwhich to send mail to. More...
 
 setSubject ($_strSubject= '')
 Message Subject. More...
 
 getSubject ()
 Retrieves the Message Subject. More...
 
 getHeader ()
 Constructes and returns message header. More...
 
 setBodyContent ($strContent, $strType= 'plain')
 Message Content. More...
 
 getBodyContent ()
 Retrieves the Message Content. More...
 
 setAttachment ($strContent, $strFileName= 'unknown', $strMimeType= 'unknown')
 File attachments are added to the content array as sub-arrays, allowing for multiple attachments for each outbound email. More...
 
 setImageInline ($strContent, $strImageName= 'unknown', $strMimeType= 'unknown', $strImageCid= 'unknown')
 Image attachments are added to the content array as sub-arrays, allowing for multiple images for each outbound email. More...
 
 setSensitivity ($_value=0)
 Message Content Sensitivity Message Sensitivity values: More...
 
 getSensitivity ()
 Returns Message Content Sensitivity string Message Sensitivity values: More...
 
 setPriority ($_value=3)
 Message Content Priority Message Priority values: More...
 
 getPriority ()
 Message Content Priority Message Priority values: More...
 
 setMD5flag ($_flag=false)
 Set flag which determines whether to calculate message MD5 checksum. More...
 
 getMD5flag ()
 Gets flag which determines whether to calculate message MD5 checksum. More...
 
 setXheader ($strXdata)
 Message X-Header Content This is a simple "insert". More...
 
 getXheader ()
 Retrieves the Message X-Header Content. More...
 
 _setBoundary ()
 Generates Random string for MIME message Boundary. More...
 
 _getBoundary ($type='mixed')
 Retrieves the MIME message Boundary. More...
 
 server_parse ($socket, $response)
 This function has been modified as provided by SirSir to allow multiline responses when using SMTP Extensions. More...
 
 socket_send_str ($_strSend, $_returnCode=null, $CRLF="\r\n")
 Send str. More...
 
 _setErr ($_errNum, $_errMsg)
 Defines errors codes and messages for Class. More...
 
 getErrors ()
 Returns errors codes and messages for Class. More...
 

Public Attributes

 $_smtpsHost = 'localhost'
 Host Name or IP of SMTP Server to use.
 
 $_smtpsPort = '25'
 SMTP Server Port definition. More...
 
 $_smtpsID = null
 Secure SMTP Server access ID This can be defined via a INI file or via a setter method.
 
 $_smtpsPW = null
 Secure SMTP Server access Password This can be defined via a INI file or via a setter method.
 
 $_msgFrom = null
 Who sent the Message This can be defined via a INI file or via a setter method.
 
 $_msgReplyTo = null
 Where are replies and errors to be sent to This can be defined via a INI file or via a setter method.
 
 $_msgRecipients = null
 Who will the Message be sent to; TO, CC, BCC Multi-diminsional array containg addresses the message will be sent TO, CC or BCC.
 
 $_msgSubject = null
 Message Subject.
 
 $_msgContent = null
 Message Content.
 
 $_msgXheader = null
 Custom X-Headers.
 
 $_smtpsCharSet = 'iso-8859-1'
 Character set Defaulted to 'iso-8859-1'.
 
 $_msgSensitivity = 0
 Message Sensitivity Defaults to ZERO - None.
 
 $_arySensitivity
 Message Sensitivity.
 
 $_msgPriority = 3
 Message Sensitivity Defaults to 3 - Normal.
 
 $_aryPriority
 Message Priority.
 
 $_smtpsTransEncodeType = 0
 Content-Transfer-Encoding Defaulted to 0 - 7bit.
 
 $_smtpsTransEncodeTypes
 Content-Transfer-Encoding.
 
 $_smtpsTransEncode = '7bit'
 Content-Transfer-Encoding Defaulted to '7bit'.
 
 $_smtpsBoundary = null
 Boundary String for MIME seperation.
 
 $_smtpsRelatedBoundary = null
 Related Boundary.
 
 $_smtpsAlternativeBoundary = null
 Alternative Boundary.
 
 $_transportType = 0
 Determines the method inwhich the message are to be sent. More...
 
 $_mailPath = '/usr/lib/sendmail'
 If '$_transportType' is set to '1', then this variable is used to define the UNIX file system path to the sendmail execuable.
 
 $_smtpTimeout = 10
 Sets the SMTP server timeout in seconds.
 
 $_smtpMD5 = false
 Determines whether to calculate message MD5 checksum.
 
 $_smtpsErrors = null
 Class error codes and messages.
 
 $_log_level = 0
 Defines log level 0 - no logging 1 - connectivity logging 2 - message generation logging 3 - detail logging.
 
 $_debug = false
 Place Class in" debug" mode.
 

Detailed Description

Class to construct and send SMTP compliant email, even to a secure SMTP server, regardless of platform.

Definition at line 46 of file smtps.class.php.

Member Function Documentation

SMTPs::_buildAddrList (   $_type,
  $_addrList 
)

Inserts given addresses into structured format.

This method takes a list of given addresses, via an array or a COMMA delimted string, and inserts them into a highly structured array. This array is designed to remove duplicate addresses and to sort them by Domain.

Parameters
string$_typeTO, CC, or BCC lists to add addrresses into
mixed$_addrListArray or COMMA delimited string of addresses
Returns
void

Definition at line 983 of file smtps.class.php.

References $_msgRecipients.

Referenced by setBCC(), setCC(), and setTO().

SMTPs::_getBoundary (   $type = 'mixed')

Retrieves the MIME message Boundary.

Parameters
string$typeType of boundary
Returns
string $_smtpsBoundary MIME message Boundary

Definition at line 1740 of file smtps.class.php.

References $_smtpsAlternativeBoundary, $_smtpsBoundary, and $_smtpsRelatedBoundary.

Referenced by getBodyContent().

SMTPs::_server_authenticate ( )

Attempt mail server authentication for a secure connection.

Returns
boolean|null $_retVal Boolean indicating success or failure of authentication

Definition at line 414 of file smtps.class.php.

References _setErr(), getFrom(), getHost(), and socket_send_str().

Referenced by sendMsg().

SMTPs::_server_connect ( )

Attempt a connection to mail server.

Returns
mixed $_retVal Boolean indicating success or failure on connection

Definition at line 352 of file smtps.class.php.

References _setErr(), getHost(), getPort(), is_ip(), and server_parse().

Referenced by sendMsg().

SMTPs::_setBoundary ( )

Generates Random string for MIME message Boundary.

Returns
void

Definition at line 1727 of file smtps.class.php.

Referenced by getBodyContent().

SMTPs::_setErr (   $_errNum,
  $_errMsg 
)

Defines errors codes and messages for Class.

Parameters
int$_errNumError Code Number
string$_errMsgError Message
Returns
void

Definition at line 1816 of file smtps.class.php.

Referenced by _server_authenticate(), _server_connect(), get_email_list(), server_parse(), and setConfig().

SMTPs::_strip_email (   $_strAddr)

Returns an array of the various parts of an email address This assumes a well formed address:

  • "Real name" usern.nosp@m.ame@.nosp@m.domai.nosp@m.n.tl.nosp@m.d
  • "Real Name" is optional
  • if "Real Name" does not exist, the angle brackets are optional This will split an email address into 4 or 5 parts.
  • $_aryEmail[org] = orignal string
  • $_aryEmail[real] = "real name" - if there is one
  • $_aryEmail[addr] = address part "username@domain.tld"
  • $_aryEmail[host] = "domain.tld"
  • $_aryEmail[user] = "userName"

    Parameters
    string$_strAddrEmail address
    Returns
    array An array of the various parts of an email address

Definition at line 1055 of file smtps.class.php.

Referenced by setErrorsTo(), setFrom(), and setReplyTo().

SMTPs::buildRCPTlist ( )

build RECIPIENT List, all addresses who will recieve this message

Returns
void

Definition at line 341 of file smtps.class.php.

SMTPs::get_email_list (   $_which = null)

Returns an array of addresses for a specific type; TO, CC or BCC.

Parameters
string$_whichWhich collection of addresses to return ('to', 'cc', 'bcc')
Returns
string|false Array of emaill address

Definition at line 1126 of file smtps.class.php.

References _setErr().

Referenced by getBCC(), getCC(), and getTo().

SMTPs::get_RCPT_list ( )

Returns an array of bares addresses for use with 'RCPT TO:' This is a "build as you go" method.

Each time this method is called the underlaying array is destroyed and reconstructed.

Returns
array Returns an array of bares addresses

An array of bares addresses for use with 'RCPT TO:'

Definition at line 1097 of file smtps.class.php.

Referenced by sendMsg().

SMTPs::getBCC ( )

Retrieves the BCC Address[es] inwhich to send mail to.

Returns
string BCC Address[es] inwhich to send mail to

Definition at line 1232 of file smtps.class.php.

References get_email_list().

SMTPs::getBodyContent ( )

Retrieves the Message Content.

Returns
string Message Content

Definition at line 1387 of file smtps.class.php.

References $_msgContent, _getBoundary(), _setBoundary(), getCharSet(), getMD5flag(), and getTransEncodeType().

Referenced by sendMsg().

SMTPs::getCC ( )

Retrieves the CC Address[es] inwhich to send mail to.

Returns
string CC Address[es] inwhich to send mail to

Definition at line 1210 of file smtps.class.php.

References get_email_list().

Referenced by getHeader().

SMTPs::getCharSet ( )

Retrieves the Character set used for current message.

Returns
string $_smtpsCharSet Character set used for current message

Definition at line 840 of file smtps.class.php.

References $_smtpsCharSet.

Referenced by getBodyContent().

SMTPs::getDeliveryReceipt ( )

get delivery receipt

Returns
int Delivery receipt

Definition at line 248 of file smtps.class.php.

Referenced by getHeader().

SMTPs::getErrors ( )

Returns errors codes and messages for Class.

Returns
string $_errMsg Error Message

Definition at line 1827 of file smtps.class.php.

SMTPs::getErrorsTo (   $_part = true)

Get errors to.

Parameters
boolean$_partVariant
Returns
string Errors to

Definition at line 313 of file smtps.class.php.

Referenced by getHeader().

SMTPs::getFrom (   $_part = true)

Retrieves the Address from which mail will be sent.

Parameters
boolean$_partTo "strip" 'Real name' from address
Returns
string Address from which mail will be sent

Definition at line 929 of file smtps.class.php.

References $_msgFrom.

Referenced by _server_authenticate(), getHeader(), and sendMsg().

SMTPs::getHeader ( )

Constructes and returns message header.

Returns
string Complete message header

Definition at line 1264 of file smtps.class.php.

References getCC(), getDeliveryReceipt(), getErrorsTo(), getFrom(), getHost(), getMoreInHeader(), getPriority(), getReplyTo(), getSensitivity(), getSubject(), and getTrackId().

Referenced by sendMsg().

SMTPs::getHost ( )

Retrieves the Host Name or IP of the Mail Server to use This is used only with 'socket' based mail transmission.

Returns
string $_strHost Host Name or IP of the Mail Server to use

Definition at line 749 of file smtps.class.php.

References $_smtpsHost.

Referenced by _server_authenticate(), _server_connect(), getHeader(), and sendMsg().

SMTPs::getID ( )

Retrieves the User Name for authentication on Mail Server.

Returns
string User Name for authentication on Mail Server

Definition at line 796 of file smtps.class.php.

References $_smtpsID.

SMTPs::getMD5flag ( )

Gets flag which determines whether to calculate message MD5 checksum.

Returns
boolean Message Priority

Definition at line 1693 of file smtps.class.php.

References $_smtpMD5.

Referenced by getBodyContent(), setAttachment(), setBodyContent(), and setImageInline().

SMTPs::getMoreInHeader ( )

get moreInHeader

Returns
string moreInHeader

Definition at line 290 of file smtps.class.php.

Referenced by getHeader().

SMTPs::getPort ( )

Retrieves the Port Number of the Mail Server to use This is used only with 'socket' based mail transmission.

Returns
string Port Number of the Mail Server to use

Definition at line 775 of file smtps.class.php.

References $_smtpsPort.

Referenced by _server_connect().

SMTPs::getPriority ( )

Message Content Priority Message Priority values:

  • [0] 'Bulk'
  • [1] 'Highest'
  • [2] 'High'
  • [3] 'Normal' - default
  • [4] 'Low'
  • [5] 'Lowest'
Returns
string

Definition at line 1670 of file smtps.class.php.

References $_msgPriority.

Referenced by getHeader().

SMTPs::getPW ( )

Retrieves the User Password for authentication on Mail Server.

Returns
string User Password for authentication on Mail Server

Definition at line 817 of file smtps.class.php.

References $_smtpsPW.

SMTPs::getReplyTo (   $_part = true)

Retrieves the Address from which mail will be the reply-to.

Parameters
boolean$_partTo "strip" 'Real name' from address
Returns
string Address from which mail will be the reply-to

Definition at line 959 of file smtps.class.php.

References $_msgReplyTo.

Referenced by getHeader().

SMTPs::getSensitivity ( )

Returns Message Content Sensitivity string Message Sensitivity values:

  • [0] None - default
  • [1] Personal
  • [2] Private
  • [3] Company Confidential
Returns
void

Definition at line 1633 of file smtps.class.php.

References $_msgSensitivity.

Referenced by getHeader().

SMTPs::getSubject ( )

Retrieves the Message Subject.

Returns
string Message Subject

Definition at line 1254 of file smtps.class.php.

References $_msgSubject.

Referenced by getHeader().

SMTPs::getTo ( )

Retrieves the TO Address[es] inwhich to send mail to.

Returns
string TO Address[es] inwhich to send mail to

Definition at line 1188 of file smtps.class.php.

References get_email_list().

SMTPs::getTrackId ( )

get trackid

Returns
string Track id

Definition at line 280 of file smtps.class.php.

Referenced by getHeader().

SMTPs::getTransEncode ( )

Retrieves the Content-Transfer-Encoding.

Returns
string $_smtpsTransEncode Content-Transfer-Encoding

Definition at line 871 of file smtps.class.php.

References $_smtpsTransEncode.

SMTPs::getTransEncodeType ( )

Retrieves the Content-Transfer-Encoding.

Returns
string Content-Transfer-Encoding

Definition at line 903 of file smtps.class.php.

References $_smtpsTransEncodeType.

Referenced by getBodyContent().

SMTPs::getTransportType ( )

Return the method inwhich the message is to be sent.

  • 'sockets' [0] - conect via network to SMTP server
  • 'pipe [1] - use UNIX path to EXE
  • 'phpmail [2] - use the PHP built-in mail function
Returns
int $_strHost Host Name or IP of the Mail Server to use

Definition at line 709 of file smtps.class.php.

References $_transportType.

SMTPs::getXheader ( )

Retrieves the Message X-Header Content.

Returns
string[] $_msgContent Message X-Header Content

Definition at line 1717 of file smtps.class.php.

References $_msgXheader.

SMTPs::sendMsg (   $_bolTestMsg = false,
  $_bolDebug = false 
)

Now send the message.

Parameters
boolean$_bolTestMsgwhether to run this method in 'Test' mode.
boolean$_bolDebugwhether to log all communication between this Class and the Mail Server.
Returns
boolean|null void $_strMsg If this is run in 'Test' mode, the actual message structure will be returned

Default return value

Definition at line 524 of file smtps.class.php.

References _server_authenticate(), _server_connect(), get_RCPT_list(), getBodyContent(), getFrom(), getHeader(), getHost(), and socket_send_str().

SMTPs::server_parse (   $socket,
  $response 
)

This function has been modified as provided by SirSir to allow multiline responses when using SMTP Extensions.

Parameters
Handler$socketSocket handler
string$responseResponse. Example: "550 5.7.1 https://support.google.com/a/answer/6140680#invalidcred j21sm814390wre.3"
Returns
boolean True or false

Returns constructed SELECT Object string or boolean upon failure Default value is set at TRUE

Definition at line 1755 of file smtps.class.php.

References _setErr().

Referenced by _server_connect(), and socket_send_str().

SMTPs::setAttachment (   $strContent,
  $strFileName = 'unknown',
  $strMimeType = 'unknown' 
)

File attachments are added to the content array as sub-arrays, allowing for multiple attachments for each outbound email.

Parameters
string$strContentFile data to attach to message
string$strFileNameFile Name to give to attachment
string$strMimeTypeFile Mime Type of attachment
Returns
void

Definition at line 1561 of file smtps.class.php.

References dol_hash(), and getMD5flag().

SMTPs::setBCC (   $_strBCC)

BCC Address[es] inwhich to send mail to.

Parameters
string$_strBCCRecipients BCC Address[es] inwhich to send mail to
Returns
void

Definition at line 1221 of file smtps.class.php.

References _buildAddrList().

SMTPs::setBodyContent (   $strContent,
  $strType = 'plain' 
)

Message Content.

Parameters
string$strContentMessage Content
string$strTypeType
Returns
void

Definition at line 1348 of file smtps.class.php.

References dol_hash(), and getMD5flag().

SMTPs::setCC (   $_strCC)

CC Address[es] inwhich to send mail to.

Parameters
string$_strCCCC Address[es] inwhich to send mail to
Returns
void

Definition at line 1199 of file smtps.class.php.

References _buildAddrList().

SMTPs::setCharSet (   $_strCharSet)

Character set used for current message Character set is defaulted to 'iso-8859-1';.

Parameters
string$_strCharSetCharacter set used for current message
Returns
void

Definition at line 829 of file smtps.class.php.

SMTPs::setConfig (   $_strConfigPath = null)

setConfig() is used to populate select class properties from either a user defined INI file or the systems 'php.ini' file

If a user defined INI is to be used, the files complete path is passed as the method single parameter. The INI can define any class and/or user properties. Only properties defined within this file will be setter and/or orverwritten

If the systems 'php.ini' file is to be used, the method is called without parameters. In this case, only HOST, PORT and FROM properties will be set as they are the only properties that are defined within the 'php.ini'.

If secure SMTP is to be used, the user ID and Password can be defined with the user INI file, but the properties are not defined with the systems 'php.ini'file, they must be defined via their setter methods

This method can be called twice, if desired. Once without a parameter to load the properties as defined within the systems 'php.ini' file, and a second time, with a path to a user INI file for other properties to be defined.

Parameters
mixed$_strConfigPathpath to config file or VOID
Returns
boolean

Returns constructed SELECT Object string or boolean upon failure Default value is set at TRUE

Definition at line 646 of file smtps.class.php.

References _setErr(), setFrom(), setHost(), and setPort().

SMTPs::setDebug (   $_vDebug = false)

Set debug.

Parameters
boolean$_vDebugValue for debug
Returns
void

Definition at line 331 of file smtps.class.php.

SMTPs::setDeliveryReceipt (   $_val = 0)

Set delivery receipt.

Parameters
int$_valValue
Returns
void

Definition at line 238 of file smtps.class.php.

SMTPs::setErrorsTo (   $_strErrorsTo)

Set errors to.

Parameters
string$_strErrorsToErrors to
Returns
void

Definition at line 301 of file smtps.class.php.

References _strip_email().

SMTPs::setFrom (   $_strFrom)

FROM Address from which mail will be sent.

Parameters
string$_strFromAddress from which mail will be sent
Returns
void

Definition at line 917 of file smtps.class.php.

References _strip_email().

Referenced by setConfig().

SMTPs::setHost (   $_strHost)

Defines the Host Name or IP of the Mail Server to use.

This is defaulted to 'localhost' This is used only with 'socket' based mail transmission

Parameters
string$_strHostHost Name or IP of the Mail Server to use
Returns
void

Definition at line 737 of file smtps.class.php.

Referenced by setConfig().

SMTPs::setID (   $_strID)

User Name for authentication on Mail Server.

Parameters
string$_strIDUser Name for authentication on Mail Server
Returns
void

Definition at line 786 of file smtps.class.php.

SMTPs::setImageInline (   $strContent,
  $strImageName = 'unknown',
  $strMimeType = 'unknown',
  $strImageCid = 'unknown' 
)

Image attachments are added to the content array as sub-arrays, allowing for multiple images for each outbound email.

Parameters
string$strContentImage data to attach to message
string$strImageNameImage Name to give to attachment
string$strMimeTypeImage Mime Type of attachment
string$strImageCidCID
Returns
void

Definition at line 1589 of file smtps.class.php.

References dol_hash(), and getMD5flag().

SMTPs::setMailPath (   $_path)

Path to the sendmail execuable.

Parameters
string$_pathPath to the sendmail execuable
Returns
boolean

Definition at line 721 of file smtps.class.php.

SMTPs::setMD5flag (   $_flag = false)

Set flag which determines whether to calculate message MD5 checksum.

Parameters
string$_flagMessage Priority
Returns
void

Definition at line 1683 of file smtps.class.php.

SMTPs::setMoreInHeader (   $_val = '')

Set moreInHeader.

Parameters
string$_valValue
Returns
void

Definition at line 270 of file smtps.class.php.

SMTPs::setPort (   $_intPort)

Defines the Port Number of the Mail Server to use This is defaulted to '25' This is used only with 'socket' based mail transmission.

Parameters
int$_intPortPort Number of the Mail Server to use
Returns
void

Definition at line 762 of file smtps.class.php.

Referenced by setConfig().

SMTPs::setPriority (   $_value = 3)

Message Content Priority Message Priority values:

  • [0] 'Bulk'
  • [1] 'Highest'
  • [2] 'High'
  • [3] 'Normal' - default
  • [4] 'Low'
  • [5] 'Lowest'
Parameters
integer$_valueMessage Priority
Returns
void

Definition at line 1651 of file smtps.class.php.

SMTPs::setPW (   $_strPW)

User Password for authentication on Mail Server.

Parameters
string$_strPWUser Password for authentication on Mail Server
Returns
void

Definition at line 807 of file smtps.class.php.

SMTPs::setReplyTo (   $_strReplyTo)

Reply-To Address from which mail will be the reply-to.

Parameters
string$_strReplyToAddress from which mail will be the reply-to
Returns
void

Definition at line 947 of file smtps.class.php.

References _strip_email().

SMTPs::setSensitivity (   $_value = 0)

Message Content Sensitivity Message Sensitivity values:

  • [0] None - default
  • [1] Personal
  • [2] Private
  • [3] Company Confidential
Parameters
integer$_valueMessage Sensitivity
Returns
void

Definition at line 1616 of file smtps.class.php.

SMTPs::setSubject (   $_strSubject = '')

Message Subject.

Parameters
string$_strSubjectMessage Subject
Returns
void

Definition at line 1243 of file smtps.class.php.

SMTPs::setTO (   $_addrTo)

TO Address[es] inwhich to send mail to.

Parameters
string$_addrToTO Address[es] inwhich to send mail to
Returns
void

Definition at line 1177 of file smtps.class.php.

References _buildAddrList().

SMTPs::setTrackId (   $_val = '')

Set trackid.

Parameters
string$_valValue
Returns
void

Definition at line 259 of file smtps.class.php.

SMTPs::setTransEncode (   $_strTransEncode)

Content-Transfer-Encoding, Defaulted to '7bit' This can be changed for 2byte characers sets Known Encode Types.

  • 7bit Simple 7-bit ASCII
  • 8bit 8-bit coding with line termination characters
  • base64 3 octets encoded into 4 sextets with offset
  • binary Arbitrary binary stream
  • mac-binhex40 Macintosh binary to hex encoding
  • quoted-printable Mostly 7-bit, with 8-bit characters encoded as "=HH"
  • uuencode UUENCODE encoding
Parameters
string$_strTransEncodeContent-Transfer-Encoding
Returns
void

Definition at line 860 of file smtps.class.php.

SMTPs::setTransEncodeType (   $_strTransEncodeType)

Content-Transfer-Encoding, Defaulted to '0' [ZERO] This can be changed for 2byte characers sets Known Encode Types.

  • [0] 7bit Simple 7-bit ASCII
  • [1] 8bit 8-bit coding with line termination characters
  • [2] base64 3 octets encoded into 4 sextets with offset
  • [3] binary Arbitrary binary stream
  • [4] mac-binhex40 Macintosh binary to hex encoding
  • [5] quoted-printable Mostly 7-bit, with 8-bit characters encoded as "=HH"
  • [6] uuencode UUENCODE encoding
Parameters
string$_strTransEncodeTypeContent-Transfer-Encoding
Returns
void

Definition at line 892 of file smtps.class.php.

SMTPs::setTransportType (   $_type = 0)

Determines the method inwhich the messages are to be sent.

  • 'sockets' [0] - conect via network to SMTP server
  • 'pipe [1] - use UNIX path to EXE
  • 'phpmail [2] - use the PHP built-in mail function
Parameters
int$_typeInterger value representing Mail Transport Type
Returns
void

Definition at line 694 of file smtps.class.php.

SMTPs::setXheader (   $strXdata)

Message X-Header Content This is a simple "insert".

Whatever is given will be placed "as is" into the Xheader array.

Parameters
string$strXdataMessage X-Header Content
Returns
void

Definition at line 1706 of file smtps.class.php.

SMTPs::socket_send_str (   $_strSend,
  $_returnCode = null,
  $CRLF = "\r\n" 
)

Send str.

Parameters
string$_strSendString to send
string$_returnCodeReturn code
string$CRLFCRLF
Returns
boolean|null True or false

Definition at line 1796 of file smtps.class.php.

References server_parse().

Referenced by _server_authenticate(), and sendMsg().

Member Data Documentation

SMTPs::$_smtpsPort = '25'

SMTP Server Port definition.

25 is default value This can be defined via a INI file or via a setter method

Definition at line 57 of file smtps.class.php.

Referenced by getPort().

SMTPs::$_transportType = 0

Determines the method inwhich the message are to be sent.

  • 'sockets' [0] - conect via network to SMTP server - default
  • 'pipe [1] - use UNIX path to EXE
  • 'phpmail [2] - use the PHP built-in mail function NOTE: Only 'sockets' is implemented

Definition at line 186 of file smtps.class.php.

Referenced by getTransportType().


The documentation for this class was generated from the following file: