Check e-mail address validity(SMTP)
In my work I am asking my self is there way to check e-mail address validity.Here is one oh the decisions...
AI
AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Source Code
<font size="2" face="Verdana"><b>Check e-mail address validity </b></font> <p><font size="2" face="Verdana">In my work I am asking my self is there way to check e-mail address validity.Let's look over the following lines:<br> This is simple communication between user and SMTP server:</font></p> <p><font size="2" face="Verdana"><i>(Server) 220 server5.donhost.co.uk ESMTP<br> (User) helo localhost<br> (Server) 250 server5.donhost.co.uk<br> (User) mail from:admin<[email protected]><br> (Server) 250 ok<br> (User) rcpt to:contest<[email protected]><br> (Server) 250 ok<br> (User) data<br> (Server) 354 go ahead<br> (User) subject:this is a test<br> (User) hello friend how are you?<br> .<br> (Server) 250 ok 1019555935 qp 93990 <br> (User) quit<br> (Server) 221 server5.donhost.co.uk </i></font></p> <p><font size="2" face="Verdana">Then let's look over the following lines:</font></p> <p><font size="2" face="Verdana"><i>(Server) 220 astral.acvilon.com ESMTP Sendmail 8.11.6/8.11.6; Tue, 23 Apr 2002 13:43:10 +<br> 0300<br> helo localhost<br> (Server) 250 astral.acvilon.com Hello [195.24.48.45], pleased to meet you<br> (User) mail from:[email protected]<br> (Server) 250 2.1.0 [email protected]... Sender ok<br> (User) rcpt to:[email protected]<br> (Server) 550 5.1.1 [email protected]... User unknown</i></font></p> <p><font size="2" face="Verdana"><br> If web server support the user recognition, the result should be 'User unknown'</font></p> <p><font size="2" face="Verdana"><b>PHP implementation</b></font></p> <p><font size="2" face="Verdana" color="#0000A0"><?PHP<br> class CEmail{</font></p> <p><font size="2" face="Verdana" color="#0000A0">function check($host,$user){</font></p> <p><font size="2" face="Verdana" color="#0000A0">$fp = fsockopen ($host, 25);<br> set_socket_blocking ($fp, true);<br> fputs ($fp, "Helo Local\n");<br> fgets ($fp, 2000);<br> fgets ($fp, 2000);<br> fputs ($fp, "Mail From:<$user@$host> \n");<br> fgets ($fp, 2000);<br> fputs ($fp, "RCPT to:aetos<$user@$host> \n");<br> $result= fgets ($fp, 2000);<br> $st= substr($result,0,3);<br> if ($st==250){</font></p> <p><font size="2" face="Verdana" color="#0000A0"> echo"Email address is valid";<br> }<br> <br> else<br> echo"The address is not valid";<br> <br> }<br> }</font></p> <p><font size="2" face="Verdana" color="#0000A0">$m=new CEmail;<br> $m->check("acvilon.com","farkon");</font></p> <p><font size="2" face="Verdana" color="#0000A0"> ?></font><font size="2" face="Verdana"><br> This class implementing the conversation in previous chapter (SMTP & USER)</font></p> <p><font size="2" face="Verdana"><br> <br> </font> </p> Upload
Original Comments (3)
Recovered from Wayback Machine