smapidos.cpp
来自「INTERNET网络高级编程的包括邮件加密、MAPI、ISAPI、ACTIVEX」· C++ 代码 · 共 62 行
CPP
62 行
#include <windows.h>
#include <stdio.h>
#include <mapi.h>
LPMAPILOGON lpfnMAPILogon;
LPMAPISENDMAIL lpfnMAPISendMail;
LPMAPILOGOFF lpfnMAPILogoff;
MapiRecipDesc recipient=
{
0,
MAPI_TO,
"赵辉",
"SMTP:zhaohui_z@cmmail.com",
0,
NULL
};
MapiMessage message=
{
0,
"欢迎",
"你好啊,这是第二个测试\n",
NULL,
NULL,
NULL,
0,
NULL,
1,
&recipient,
0,
NULL,
};
void main(void)
{
LHANDLE lhSession;
// HANDLE hMAPILib;
HINSTANCE hMAPILib;
hMAPILib=LoadLibrary("MAPI32.DLL");
lpfnMAPILogon=
(LPMAPILOGON)GetProcAddress(hMAPILib,"MAPILogon");
lpfnMAPISendMail=
(LPMAPISENDMAIL)GetProcAddress(hMAPILib,"MAPISendMail");
lpfnMAPILogoff=
(LPMAPILOGOFF)GetProcAddress(hMAPILib,"MAPILogoff");
(*lpfnMAPILogon) (0,NULL,NULL,0,0,&lhSession);
(*lpfnMAPISendMail) (lhSession,0,&message,0,0);
(*lpfnMAPILogoff) (lhSession,0,0,0);
printf("game over\t\n");
FreeLibrary(hMAPILib);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?