请教MAPISendMail()函数的用法 请用该函数写一个发送邮件的完整程序的例子,如果您有更简单发送邮件的方法也请写出!谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 #import <cdonts.dll>#include "tchar.h"#include "stdio.h"void main(){ //The SMTP server should be running. CoInitialize(NULL); try { CDONTS::INewMailPtr spNewMail(__uuidof(CDONTS::NewMail)); spNewMail->From = _T("YourName"); spNewMail->To = _T("[email protected]"); spNewMail->Subject = _T("Testing"); spNewMail->Body = _T("Put your message here"); spNewMail->AttachFile(_variant_t(_bstr_t("C:\\tmp\\test\\mail\\mail.cpp")),_variant_t((long)DISP_E_PARAMNOTFOUND, VT_ERROR),_variant_t((long)DISP_E_PARAMNOTFOUND, VT_ERROR)); spNewMail->Send(); printf("send ok"); } catch(_com_error &ComError) { // Error handling goes here printf("%s\n",ComError.Description()); } CoUninitialize();} 我用的是VC5,没有cdonts.dll库文件,还请你用MAPISendMail()函数写一个例子,谢谢 能告诉我RTP的原理吗? 映射函数不见了 Notepad动画..(散分) 颜色降色的问题 问题咨询! 有关rs485通信的问题,有做过的达人乱入…… 关于IE浏览器编程:如何截获文件下载事件? 如何替换windows 2000下的系统文件wsock32.dll?100分! IE中有没有自带DownLoad的接口? MFC编辑框 怎么获取ListCtrl的列标题? 各位大虾!小弟有一个难题,就是怎么样才能用VC设计一个计算器。
#include "tchar.h"
#include "stdio.h"
void main()
{
//The SMTP server should be running.
CoInitialize(NULL);
try
{
CDONTS::INewMailPtr spNewMail(__uuidof(CDONTS::NewMail));
spNewMail->From = _T("YourName");
spNewMail->To = _T("[email protected]");
spNewMail->Subject = _T("Testing");
spNewMail->Body = _T("Put your message here");
spNewMail->AttachFile(_variant_t(_bstr_t("C:\\tmp\\test\\mail\\mail.cpp")),_variant_t((long)DISP_E_PARAMNOTFOUND, VT_ERROR),_variant_t((long)DISP_E_PARAMNOTFOUND, VT_ERROR));
spNewMail->Send();
printf("send ok");
}
catch(_com_error &ComError)
{
// Error handling goes here
printf("%s\n",ComError.Description());
}
CoUninitialize();
}