Hi there,

This proc here works perfect at work but at home it fails with error code 8004005 (E_FAIL)
Anyone has an idea why?

MAPImsg MapiMessage <0>
MAPIRecip MapiRecipDesc <0>
buff db 100000 dup (0)

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
SendTheEmail endp

I disabled my firewall and have outlook properly configured. I'm confused ???
Posted on 2007-07-03 09:36:18 by JimmyClif
This code works fine for me.. is outlook your default mail client?
Posted on 2007-07-03 15:21:14 by lone_samurai5
lone_samurai5, you are my savior. It wasn't my default mail handler. Now it works fine.

Posted on 2007-07-03 22:40:40 by JimmyClif