How to mail?:confused:
Posted on 2002-09-23 09:17:04 by rich
Ummm....You could be a little more descriptive.

But if you are wanting to write a program to E-mail.

Check out SMTP( see attach )

Found this from google
Your email client talks to your email server to send it commands to login, get mail status, and send and receive email. The most common protocol used by email clients to communicate with email servers is the Post Office Protocol first defined in RFC 918, with Version 2 published as RFC 937, and POP Version 3 published as RFC 1725.


Search for RFC's ( Request for Comments )
Posted on 2002-09-23 09:22:53 by gorshing
Get yourself an envelope and a stamp. ;)
Posted on 2002-09-23 09:47:42 by iblis
also check the networking forum. I believe there are ready made smtp routines there. (in general: search the FAQ and the board :grin: )
Posted on 2002-09-23 09:58:38 by Hiroshimator


.data
SMTPBuff db 'mail.mail.bg',0,0,0,0,0,0,0,0 ;pop mail server name

.code
;---------------
SendMailCommand PROC lpStrCmd:DWORD
LOCAL tmpstrlen:DWORD

INVOKE lstrlen, lpStrCmd
mov dword ptr tmpstrlen, eax
INVOKE send, hSock,lpStrCmd, eax, NULL
.IF eax==SOCKET_ERROR
szText SockErr, "SOCKET ERROR!"
INVOKE MessageBox, NULL, ADDR SockErr, ADDR AppName, MB_OK
INVOKE closesocket, hSock
RET
.ENDIF
cmp eax, dword ptr tmpstrlen
jge lab776
szText SendErr, "Many bytes sended"
INVOKE MessageBox, NULL, ADDR SendErr, ADDR AppName, MB_OK
RET

lab776:
INVOKE recv, hSock,ADDR buf1,buf1size,NULL ; read bytes from incoming
.IF eax==0
INVOKE closesocket, hSock
RET
.ELSEIF eax==SOCKET_ERROR
INVOKE MessageBox, NULL, ADDR SockErr, ADDR AppName, MB_OK
INVOKE closesocket, hSock
RET
.ELSE
mov recbyte,eax
.ENDIF

RET
SendMailCommand ENDP

;-------------------------------------
SendMail PROC SendMailBuffer:DWORD

INVOKE socket, AF_INET,SOCK_STREAM,PCL_NONE
.IF eax == -1
szText HostErr, "Host not found!"
INVOKE MessageBox, NULL, ADDR HostErr, ADDR AppName, MB_OK
RET
.ENDIF
mov hSock,eax

INVOKE inet_addr,addr SMTPBuff
.IF eax==INADDR_NONE
push offset SMTPBuff
call gethostbyname ; addres of SMTP server
.if eax == 0
INVOKE MessageBox, NULL, ADDR HostErr, ADDR AppName, MB_OK
INVOKE closesocket, hSock
RET
.endif

mov eax,dword ptr [eax+12]
mov eax,dword ptr [eax]
mov eax,dword ptr [eax]
mov SocketAddress.sin_addr,eax

.ELSE
;mov dword ptr [sockip],eax
mov SocketAddress.sin_addr,eax
.ENDIF
mov SocketAddress.sin_family,AF_INET
INVOKE htons,SMTP_PORT ;110
mov SocketAddress.sin_port,ax

;INVOKE connect ,hSock,sockaddr1,16
INVOKE connect, hSock,addr SocketAddress,sizeof SocketAddress

.IF eax==SOCKET_ERROR
szText conectErr, "Connot conect to host!"
INVOKE MessageBox, NULL, ADDR conectErr, ADDR AppName, MB_OK
INVOKE closesocket, hSock
RET
.ENDIF

INVOKE recv, hSock,ADDR buf1,buf1size,NULL ; read bytes from incoming
.IF eax==0
INVOKE closesocket, hSock
RET
.ELSEIF eax==SOCKET_ERROR
INVOKE MessageBox, NULL, ADDR SockErr, ADDR AppName, MB_OK
INVOKE closesocket, hSock
RET
.ELSE
mov recbyte,eax
.ENDIF

;HELO:
INVOKE SendMailCommand, addr outmsg1

;SEND MAIL FROM:
INVOKE SendMailCommand, addr outmsg2

;SEND RCPT TO:
INVOKE SendMailCommand, addr outmsg3

;SEND DATA
INVOKE SendMailCommand, addr outmsg4

;SEND TEXT
INVOKE SendMailCommand, SendMailBuffer

;SEND QUIT
INVOKE lstrlen, ADDR outmsg6
INVOKE send, hSock, ADDR outmsg6, eax, NULL
.IF eax==SOCKET_ERROR
INVOKE MessageBox, NULL, ADDR SockErr, ADDR AppName, MB_OK
INVOKE closesocket, hSock
RET
.ENDIF

INVOKE closesocket, hSock

RET

SendMail ENDP
;----------------------------------------------------------->END SEND MAIL



Posted on 2002-09-23 17:06:16 by martidim