vc 发送email outlook express 6 msimn.exe
来源:互联网 发布:安卓录屏直播软件 编辑:程序博客网 时间:2024/06/15 05:56
在程序中发送邮件有很多种方法,总结如下:
1,HINSTANCE hinst=ShellExecute(NULL,NULL,_T("mailto:fyzh84@126.com?subject=Contact I
Like It&cc=&bcc=&body="),NULL,NULL,SW_SHOWNORMAL);
这种方法使用的是shell,没有指定任何程序。
2,HINSTANCE hinst=ShellExecute(NULL,_T("C://Program Files//Outlook
Express//msimn.exe"),_T("/mailurl:fyzh84@126.com"),NULL,SW_SHOWNORMAL);
3,如果你想要添加附件之类的高级功能,那么建议你使用MAPI开头的windowsAPI来实现。例子代
码:
void __fastcall TForm_MainForm::ToolButton_SendToClick(TObject *Sender)
{
MapiRecipDesc *OriginatorRecipDesc=new MapiRecipDesc;
MapiRecipDesc *recipientRecipDesc=new MapiRecipDesc;
// MapiFileDesc *FileDesc=new MapiFileDesc;
MapiMessage aMapiMessage;
//接收人信息:
recipientRecipDesc-> ulReserved=0;
recipientRecipDesc-> ulRecipClass=MAPI_TO;
recipientRecipDesc-> lpszName=NULL;// "xthmpro_cn ";
recipientRecipDesc-> lpszAddress= "SMTP:xthmpro_cn@sina.com ";//Name
or Address can set noly one;
recipientRecipDesc-> ulEIDSize=0;
recipientRecipDesc-> lpEntryID=NULL;
//发送人信息:
OriginatorRecipDesc-> ulReserved=0;
OriginatorRecipDesc-> ulRecipClass=MAPI_ORIG;
OriginatorRecipDesc-> lpszName=NULL;
OriginatorRecipDesc-> lpszAddress= "SMTP:xthmpro_cn@sina.com ";//Name
or Address can set noly one;
OriginatorRecipDesc-> ulEIDSize=0;
OriginatorRecipDesc-> lpEntryID=NULL;
//Email内容:
aMapiMessage.ulReserved=0;
aMapiMessage.lpszSubject= "Hello! ";
aMapiMessage.lpszNoteText= "OK! ";
aMapiMessage.lpszMessageType=NULL;
aMapiMessage.lpszDateReceived= "2002/9/6/ 22:50 ";
aMapiMessage.lpszConversationID=NULL;
aMapiMessage.flFlags=MAPI_RECEIPT_REQUESTED;
aMapiMessage.lpOriginator=OriginatorRecipDesc;
aMapiMessage.nRecipCount=1;
aMapiMessage.lpRecips=recipientRecipDesc;
aMapiMessage.nFileCount=0;// 1
aMapiMessage.lpFiles=NULL;//FileDesc;
aMessage.Handle=Handle;
aMessage.aMapiMessage=aMapiMessage;
DWORD SendMailThreadID;
HANDLE Hthread=CreateThread
(0,0,SendMailThreadFunc,&aMessage,0,&SendMailThreadID);//参数一定要使用全局变量!
if(Hthread==NULL)
Application-> MessageBox( "Error ",NULL, MB_OK);
}
//---------------------------------------------------------------------------
DWORD CALLBACK SendMailThreadFunc(void *aMessage)
{
AMessage *aaMessage=(AMessage *)aMessage;
FLAGS flFlags=MAPI_DIALOG | MAPI_NEW_SESSION |
MAPI_LOGON_UI;
return MapiSendMail(NULL,(unsigned)aaMessage-> Handle,aaMessage->
aMapiMessage,flFlags,0);
}
- vc 发送email outlook express 6 msimn.exe
- VC 中调用默认邮件发送程序(Outlook)发送 指定附件的email
- 基于WebDAV通过outlook 发送 Email
- java利用outlook express发送邮件
- outlook express
- java 发送email 至 outlook, 中文乱码问题
- mailto发送给多人在outlook express下失败
- VC++利用MAPI实现Email发送
- Outlook Express和Outlook之间发送附件无法显示的问题
- 加快Outlook Express 6启动速度
- outlook express 邮件导入 outlook
- delphi调用OUTLOOK发送DBGRID中的数据(注意不是OUTLOOK EXPRESS ),带显示发送邮件界面。
- 如何发送一条消息通过 Outlook 对象模型与 VC++
- outlook express 接收邮件
- Outlook Express错误代码列表
- hook 与outlook express
- Outlook Express 错误代码
- Outlook Express 錯誤碼一覽表
- 深入了解VC++编译器的使用
- 关于dojo 转
- 对JSP、JAVASCRIPT、SERVLET之间数据传递的总结
- 浏览器 cookie 限制
- iframe异步加载技术及性能
- vc 发送email outlook express 6 msimn.exe
- 大道至简
- 引子——关于博客
- oracle_merge_into_用法详解
- Websphere 7小版本不同导致的JAXP兼容性问题
- 挖个坑
- Red Hat Linux根目录下的文件夹说明
- 跟我学Telerik公司的RadControls控件(三)
- ubuntu下用手机作为GPRS上网