The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Vineel Kumar Reddy Kovvuri on November 22, 2007, 03:47:00 AM

Title: sending mail using win32 api....
Post by: Vineel Kumar Reddy Kovvuri on November 22, 2007, 03:47:00 AM
hi

I can anybody please give me a clue on how to send mail(simple pop3 text mail) using win32 api....routines....

thanks inadvance...

Title: Re: sending mail using win32 api....
Post by: six_L on November 22, 2007, 05:27:43 AM
.data
MAPImsg MapiMessage <0>
MAPIRecip MapiRecipDesc <0>
buff db 100000 dup (0)

.code
SendTheEmail proc
LOCAL func,hLibrary:DWORD

invoke LoadLibrary,sadd("MAPI32.DLL")
mov hLibrary, eax
invoke GetProcAddress,eax,sadd("MAPISendMail")
mov func,eax
mov MAPImsg.lpszSubject, CTXT("SUBJECT TEXT")
mov MAPImsg.lpszNoteText, o$ buff
mov MAPImsg.nRecipCount,1
mov MAPImsg.lpOriginator, o$ MAPIRecip
mov MAPImsg.lpRecips,o$ MAPIRecip
mov MAPIRecip.ulRecipClass,MAPI_TO
mov MAPIRecip.lpszName,CTXT("Jimmy Clif")
mov MAPIRecip.lpszAddress,CTXT("SMTP:jimmyclif@fastmail.fm")

Scall func,0,0,o$ MAPImsg,MAPI_NEW_SESSION,0
PrintHex eax

invoke FreeLibrary,hLibrary
ret
SendTheEmail endp
Title: Re: sending mail using win32 api....
Post by: Draakie on November 22, 2007, 05:37:23 AM
Or a robust discussion on the topic at

http://www.masm32.com/board/index.php?topic=6578.0

But sIX_L gave the crux of the matter....
Title: Re: sending mail using win32 api....
Post by: Vortex on November 22, 2007, 06:03:02 PM
An example from the GeneSys package : SendMail

[attachment deleted by admin]
Title: Re: sending mail using win32 api....
Post by: Vineel Kumar Reddy Kovvuri on November 23, 2007, 12:45:11 PM
You guys r the best......................thanks a lot for ur help............