A asbeforelong Unregistered / Unconfirmed GUEST, unregistred user! 2003-09-11 #1 不用Indy等等实现smtp?有没有例子给一个?
D DeityFox Unregistered / Unconfirmed GUEST, unregistred user! 2003-09-12 #4 有阿,转贴:<br>procedure sendmail(ipchar;port:integer);<br>var<br>s:tsocket;<br>server:tsockaddr;<br>wsa:twsadata;<br>recvbuffer,sendbuffer:array[0..255] of char;<br>begin<br>wsastartup($0101,wsa);<br>s:=socket(af_inet,sock_stream,0);<br>if s<>invalid_socket then<br> begin<br> server.sin_port:=htons(port);<br> server.sin_family:=af_inet;<br> server.sin_addr.addr:=inet_addr(ip);<br> connect(s,server,sizeof(server),0);<br> recv(s,recvbuffer,0);<br> strpcopy(sendbuffer,'HELO'#13#10);<br> send(s,sendbuffer,6);<br> //.......相同的道理发送MAIL FROM: YOUR_MAIL_ADDRESS;DATA;QUIT等命令。<br> end;<br>closesocket(s);<br>wsacleanup;<br>end;
有阿,转贴:<br>procedure sendmail(ipchar;port:integer);<br>var<br>s:tsocket;<br>server:tsockaddr;<br>wsa:twsadata;<br>recvbuffer,sendbuffer:array[0..255] of char;<br>begin<br>wsastartup($0101,wsa);<br>s:=socket(af_inet,sock_stream,0);<br>if s<>invalid_socket then<br> begin<br> server.sin_port:=htons(port);<br> server.sin_family:=af_inet;<br> server.sin_addr.addr:=inet_addr(ip);<br> connect(s,server,sizeof(server),0);<br> recv(s,recvbuffer,0);<br> strpcopy(sendbuffer,'HELO'#13#10);<br> send(s,sendbuffer,6);<br> //.......相同的道理发送MAIL FROM: YOUR_MAIL_ADDRESS;DATA;QUIT等命令。<br> end;<br>closesocket(s);<br>wsacleanup;<br>end;
Z zjan521 Unregistered / Unconfirmed GUEST, unregistred user! 2003-09-12 #5 不用现成的就得你自己写。办法怎么会没有呢 SDK往上搬<br>如果是特殊情况不能用的话 参考Indy等等里边的实现,麻烦喽