|
关于c++ 研发mobile手机outlook电子邮件的研发
[复制链接]
关于c++ 研发mobile手机outlook电子邮件的研发
1,如何实现选择mail帐号
2,发送指定邮件的功能
以下是我的代码,能把相关信息插入到邮件,但没有发信人的帐号选择.这个功能如何实现?
代码如下:
BOOL LanchSymtemEmailEditor(TCHAR *TPic,const TCHAR* EmailAddress, const TCHAR* Subject, const TCHAR* EmailBody)
{
int commandLength = wcslen(EmailAddress)+100;
if (Subject)
{
commandLength+=wcslen(Subject);
}
if (EmailBody)
{
commandLength+=wcslen(EmailBody);
}
TCHAR *commandLine = new TCHAR[commandLength];
memset((char*)commandLine, 0, sizeof(TCHAR)*commandLength);
TCHAR szAppName[MAX_PATH];
lstrcpy(szAppName, _T("\\windows\\tmail.exe"));
PROCESS_INFORMATION procInfo;
if(TPic)
{
swprintf(commandLine,_T("-service \"ActiveSync\" -to \"%s\" -body \"%s\" -subject \"%s\" -attach \"%s\""), EmailAddress, EmailBody, Subject,TPic);
}
else
{
swprintf(commandLine,_T("-service \"ActiveSync\" -to \"%s\" -from \"%s\" -body \"%s\" -subject \"%s\""), EmailAddress,EmailAddress, EmailBody, Subject);
}
if( ! CreateProcess(szAppName, commandLine, NULL,NULL,
FALSE, CREATE_NEW_CONSOLE, NULL, NULL, NULL, &procInfo))
{
return FALSE;
}
CloseHandle( procInfo.hProcess );
CloseHandle(procInfo.hThread);
delete []commandLine;
commandLine = NULL;
return TRUE;
}
msn:lihualiu81@hotmail.com
qq:86556886
|
|