<?xml version="1.0"?><phpdoc><class name="Bs_EmailValidator" extends="Bs_NetApplication" undoc="false" access="public" package="net/email"><file>C:/usr/local/lib/php/blueshoes-4.2/core/net/email/Bs_EmailValidator.class.php</file><doc><author>Andrej Arn &amp;lt;andrej at blueshoes dot org&amp;gt;</author><inherited src="Array"/><overriden src="Array"/><description>features:- validate syntax- validate host- validate mailboxmissing:- validate mailing lists?if you&amp;apos;re looking for information about the smtp protocol, try these, have fun :)SIMPLE MAIL TRANSFER PROTOCOL    ftp://ftp.isi.edu/in-notes/std/std10.txt   (yes it&amp;apos;s from 1982)note: these methods don&amp;apos;t trim() the given email address. do it yourself...dependencies: Net/Bs_NetApplication (which uses Net/Bs_SocketClient and Net/Bs_Url),Util/Bs_System, Bs_Db for usesFreemailProvider(), Bs_EmailUtil,</description><shortdescription>Validates email addresses.</shortdescription><version>4.0.$id$</version><copyright>blueshoes.org</copyright></doc><function name="Bs_EmailValidator" undoc="false" access="public"><doc><return type="void"/><description/><shortdescription>Constructor</shortdescription></doc></function><function name="validateSyntax" undoc="false" access="public"><doc><parameter name="$email" type="string"/><return name="" type="bool">true if the syntax of the address is valid, false otherwise.</return><description>if you want to validate AND parse it, use Bs_EmailUtil-&amp;gt;parse().</description><shortdescription>Validates the syntax of a given email address.</shortdescription></doc></function><function name="validateHost" undoc="false" access="public"><doc><parameter name="$email" type="string"/><return name="" type="bool">true if the host of the address is valid, an error code otherwise (see constants).</return><description>a syntax check is done first also.windows hell: this method needs getMxRr() and checkDnsRr() which are broken on some win systems.there are workarounds, pure php implementations in Net/NetUtil.class.php calledcheckDnsRr_winNT() and getMxRr_winNT(). but since they need the exec() command, whichagain is broken on some win systems, this method validateHost() just returnsBS_EMAILVALIDATOR_ERROR_NOT_CAPABLE for all windows systems (after the email addresshas been syntax-checked). check the mentioned Net/NetUtil.class.php file for furtherinformation.</description><shortdescription>Validates the host part of a given email address with a connection to the host.</shortdescription></doc></function><function name="validateMailbox" undoc="false" access="public"><doc><see type="var">$serverName</see><see type="var">$senderAddress</see><see type="var">$newAddress</see><parameter name="$email" type="string"/><return name="" type="mixed"> (bool TRUE if the mailbox exists, an error code or warning code otherwise (see constants).)</return><throws>bs_exception on connection problems</throws><throws>eg if the host was invalid. maybe use $this-&amp;gt;validateHost() first.</throws><description>a syntax check is done first also.Identifies itself as server $this-&amp;gt;serverName, uses email address $this-&amp;gt;senderAddressand probably sets $this-&amp;gt;newAddress if you should rather use another email address.</description><shortdescription>Validates the mailbox of a given email address with a connection to the mailserver.</shortdescription></doc></function><function name="usesFreemailProvider" undoc="false" access="public"><doc><parameter name="$email" type="string">(email or domain)</parameter><return name="" type="bool"> (TRUE if it does, FALSE if not or if we can&amp;apos;t tell.)</return><description>freemail providers may become &amp;quot;paid services&amp;quot; or at least offer sommeadditional services for money. i still throw them into the same category.while an isp where ppl have their dialup account also is different.i think it&amp;apos;s ok to have that method here in Bs_EmailValidator, it&amp;apos;s kindaa validation too. but it may also go into a new Bs_Email[Util] class.dependencies: the BsKb.FreemailProvider table is needed.</description><shortdescription>tells if the given email address (or domain) is from a freemail provider.</shortdescription></doc></function><function name="connect" undoc="true" access="private"><doc><parameter name="$host" type="string">like &amp;apos;your.server.com&amp;apos; or an ip address like &amp;apos;111.111.111.111&amp;apos;.</parameter><parameter name="$port" default="NULL," type="int">the tcp port number.</parameter><parameter name="$persistent" default="FALSE," type="bool">default is FALSE.</parameter><parameter name="$timeOut" default="NULL," type="int">for temp conn default is 0, for main conn it&amp;apos;s 30.</parameter><parameter name="$blocking" default="TRUE" type="bool">default is TRUE, see Bs_SocketClient-&amp;gt;setBlocking().</parameter><return type="void"/><overriden src="Bs_NetApplication"/><description/><shortdescription>Overwrites the parent method, but still makes use of it.</shortdescription></doc></function><function name="disconnect" undoc="true" access="private"><doc><return type="void"/><overriden src="Bs_NetApplication"/><description/><shortdescription>Overwrites the parent method, but still makes use of it.</shortdescription></doc></function><function name="&amp;_raiseError" undoc="false" access="private"><doc><parameter name="$code" default="BS_EMAILVALIDATOR_ERROR," type="string"/><parameter name="$nativeCode" default="NULL," type="string"/><parameter name="$msg" default="&amp;apos;&amp;apos;" type="string"/><parameter name="$file" default="&amp;apos;&amp;apos;" type="string">(use __FILE__)</parameter><parameter name="$line" default="&amp;apos;&amp;apos;" type="string">(use __LINE__)</parameter><parameter name="$weight" default="&amp;apos;&amp;apos;" type="string">(&amp;apos;fatal&amp;apos;)</parameter><return type="void"/><description/><shortdescription>This method is called to generate an error.</shortdescription></doc></function><function name="getErrorMessage" undoc="false" access="public"><doc><parameter name="$errCode" type="long">a bs error code (see constants)</parameter><return name="" type="string">error message, or false if the error code was not recognized</return><description/><shortdescription>Return a textual error message for a bs emailvalidator error code</shortdescription></doc></function><variable name="$Bs_EmailUtil" access="public" type="object [unknown]"><doc><description/><shortdescription>reference to the global pseudostatic instance</shortdescription></doc></variable><variable name="$_Bs_System" access="private" type="object [unknown]"><doc><description/><shortdescription>Reference to the pseudostatic object.</shortdescription></doc></variable><variable name="$bsDb" access="public" type="object [unknown]"><doc><description>assigned in the constructor if there is one in the global scope.if there is none, and you want to use usesFreemailProvider() thenyou have to set a db object to this var yourself.</description><shortdescription>reference to the db object.</shortdescription></doc></variable><variable name="$regExp" access="public" type="string"><doc><description>hrm. as you can see ... it&amp;apos;s quite confusing. the first one is wrong, it doesn&amp;apos;t support emailaddresses that start with an underscore (which is allowed). used the second one because of the dot by now.if (eregi(&amp;quot;^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$&amp;quot;, $email, $check)) {if (eregi(&amp;quot;^[0-9a-z_]([-_.]?[0-9a-z])*@[0-9a-z][-.0-9a-z]*\\.[a-z]{2,3}[.]?$&amp;quot;, $string, $check)) {if (eregi(&amp;quot;^[0-9a-z_]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$&amp;quot;, $email, $check)).this one take from manuel lemos:&amp;quot;^[-!#\$%&amp;&amp;apos;*+./0-9=?A-Z^_`a-z{|}~ ]+@[-!#\$%&amp;&amp;apos;*+/0-9=?A-Z^_`a-z{|}~ ]+\\.+[a-zA-Z]{2,4}\$&amp;quot;</description><shortdescription>regular expressions to check the email address.</shortdescription></doc></variable><variable name="$port" access="private" type="integer">25<doc><overriden src="Bs_NetApplication"/><description/><shortdescription>overwrite default value</shortdescription></doc></variable><variable name="$serverName" access="public" type="string"><doc><description>i&amp;apos;m not sure if the receiving mailserver does anything with it, eg compares itwith our real ip/host address. but the mailserver sees our ip anyway, so whynot send the same information here.this var is used in validateMailbox() AND SET IN THE CONSTRUCTOR.</description><shortdescription>The domain name as which we identify ourself to the mailserver.</shortdescription></doc></variable><variable name="$senderAddress" access="public" type="string"><doc><description>given email address. the transaction won&amp;apos;t be finished so the receivingmailserver won&amp;apos;t deliver anything.this var is used in validateMailbox() AND SET IN THE CONSTRUCTOR.</description><shortdescription>The email address from which we initiate a send of an email to validate the</shortdescription></doc></variable><variable name="$newAddress" access="public" type="string"><doc><description>filled with it. it can be that the server just suggests it, but stillaccepts the old address, or it can be that you have to use this one.this var is used in validateMailbox().</description><shortdescription>If the server suggests another email address to send to, this var is</shortdescription></doc></variable><constant name="BS_EMAILVALIDATOR_VERSION" undoc="true" access="private" case="default: case sensitive">4.0.$x$<doc></doc></constant><constant name="BS_EMAILVALIDATOR_ERROR" undoc="true" access="private" case="default: case sensitive">1<doc></doc></constant><constant name="BS_EMAILVALIDATOR_ERROR_SYNTAX" undoc="true" access="private" case="default: case sensitive">2<doc></doc></constant><constant name="BS_EMAILVALIDATOR_ERROR_HOST" undoc="true" access="private" case="default: case sensitive">3<doc></doc></constant><constant name="BS_EMAILVALIDATOR_ERROR_NO_SUCH_USER" undoc="true" access="private" case="default: case sensitive">4<doc></doc></constant><constant name="BS_EMAILVALIDATOR_ERROR_NEW_ADDRESS" undoc="true" access="private" case="default: case sensitive">5<doc></doc></constant><constant name="BS_EMAILVALIDATOR_ERROR_COMMUNICATION" undoc="true" access="private" case="default: case sensitive">6<doc></doc></constant><constant name="BS_EMAILVALIDATOR_ERROR_NOT_CAPABLE" undoc="true" access="private" case="default: case sensitive">7<doc></doc></constant><constant name="BS_EMAILVALIDATOR_WARNING_NEW_ADDRESS" undoc="true" access="private" case="default: case sensitive">1000<doc></doc></constant><inherited src="Bs_NetApplication" type="functions"><element>_raiseerror</element><element>bs_netapplication</element></inherited><inherited src="Bs_Object" type="functions"><element>isex</element><element>isexception</element><element>tostring</element><element>tohtml</element><element>persist</element><element>unpersist</element><element>bs_object</element><element>bbsetoutput</element><element>bbawake</element><element>bbisawake</element><element>bbxmsg</element><element>bbxfunctionstart</element><element>bbxfunctionend</element><element>bbxecho</element><element>bbxvar</element><element>bbxvardump</element><element>bbforcetrace</element><element>bbbufferstart</element><element>bbbufferget</element><element>bbbufferendflush</element><element>bbbufferendclean</element></inherited><inherited src="Bs_NetApplication" type="variables"><element>$bs_url</element><element>$_bs_socketclient</element><element>$_bs_socketclient_temp</element><element>$_usetempconnection</element><element>$host</element><element>$this</element></inherited><inherited src="Bs_NetApplication" type="consts"><element>bs_netapplication_version</element></inherited><inherited src="Bs_Object" type="consts"><element>bs_object_version</element></inherited><path><parent>Bs_NetApplication</parent><parent>Bs_Object</parent></path><baseclass>Bs_Object</baseclass></class></phpdoc>