Moises,
I found these in my notes (for MAPI). It may help.
James
-----------------------
If you specify a TO and the parameter is blank and you are using the FROM USER clause, the message compose box will not appear. Likewise if the filename is invalid or not found. It is best to use an error trap:
- Code: Select all Expand view
DEFINE MAIL...
ACTIVATE MAIL...
IF oMail:nRetCode!=0
MsgAlert("The message could not be sent due to an error."+CRLF+;
"MAPI error code: "+ltrim(str(oMail:nRetCode)),"Alert")
ENDIF
------------------------
MAPI error codes
SUCCESS_SUCCESS 0
MAPI_USER_ABORT 1
MAPI_E_FAILURE 2
MAPI_E_LOGIN_FAILURE 3
MAPI_E_DISK_FULL 4
MAPI_E_INSUFFICIENT_MEMORY 5
MAPI_E_ACCESS_DENIED 6
MAPI_E_TOO_MANY_SESSIONS 8
MAPI_E_TOO_MANY_FILES 9
MAPI_E_TOO_MANY_RECIPIENTS 10
MAPI_E_ATTACHMENT_NOT_FOUND 11
MAPI_E_ATTACHMENT_OPEN_FAILURE 12
MAPI_E_ATTACHMENT_WRITE_FAILURE 13
MAPI_E_UNKNOWN_RECIPIENT 14
MAPI_E_BAD_RECIPTYPE 15
MAPI_E_NO_MESSAGES 16
MAPI_E_INVALID_MESSAGE 17
MAPI_E_TEXT_TOO_LARGE 18
MAPI_E_INVALID_SESSION 19
MAPI_E_TYPE_NOT_SUPPORTED 20
MAPI_E_AMBIGUOUS_RECIPIENT 21
MAPI_E_MESSAGE_IN_USE 22
MAPI_E_NETWORK_FAILURE 23
MAPI_E_INVALID_EDITFIELDS 24
MAPI_E_INVALID_RECIPS 25
MAPI_E_NOT_SUPPORTED 26
------------------------------
MAPISEND.EXE is a free program available here:
www.lexacorp.com.pgUsage: MAPISEND /A address(s) [/N name(s)][/S subject][/B body][/F filenames(s)][/R][/E]
If name is included it must be give AFTER address. Filenames should include full paths, separate filenames with semi-colon(;)
If /R is included, a Response will be given indicating that a message has been sent.
If /E is included, the Email program will be opened with the Message available for editing. You can pass just /E and get an empy new message dialog.
If you don't use /E the mail is sent automatically and you will probably get a warning dialog from Outlook or OE, that mail is being sent. You can turn this off in OE under Tools-Options-Security; "Warn when other applications send mail as me."
Note: Don't use quotes around the path+filename.
/S - Subject cannot be longer than 23 characters. If so, mail progam doesn't run. Cannot contain slashes either (can use dashes).
This will work under XP (32 bit MAPI). It doesn't provide CC, BC, or return receipt (you can manually add those if you use /E).
Here is an example of how to use it from within FW:
- Code: Select all Expand view
/*
Purpose: Test using MapiSend.exe from inside FW
*/
#include "fivewin.ch"
function main()
local cParams:=""
cParams:= [ /E /A whoever@hotmail.com /S "Invoice" /B "See attached." /F c:\documents and settings\james\my documents\temp\test.html]
// You can use shellexecute()
//SHELLEXECUTE( 0, 0, "mapisend", cParams, 0, 1 )
// You may use waitRun() instead. You will need to if you are mailing a temp file
// and you want to delete it after mailing.
waitRun( "mapisend "+ cParams)
sysrefresh()
msgInfo("")
return nil
---------------------------------