Windows mobile PPC 下利用 tmail.exe 发送短信、彩信、邮件
2010-03-18 21:22:00 来源:WEB开发网if (Run(strContent))
{
return TMAIL_SUCCESS;
}
else
{
DWORD deError = GetLastError();
return (TMAIL_ERROR)deError;
}
return TMAIL_SUCCESS;
}
//发送短信
TMAIL_ERROR CTmailPanel::SendSMS(TMAIL_DATA &tData)
{
if (tData.lpTo == NULL)
{
return TMAIL_PARAMETER_ERROR;
}
CString strContent,strTmp,strFormat;
strContent = _T("-service \"SMS\"");
if (tData.lpTo != NULL)
{
strTmp = tData.lpTo;
if (!strTmp.IsEmpty())
{
strTmp.Replace(_T("\""),_T("\\""));
strFormat.Format(_T(" -to \"%s\""),strTmp);
strContent += strFormat;
}
}
if (tData.lpSubject != NULL)
{
strTmp = tData.lpSubject;
if (!strTmp.IsEmpty())
{
strTmp.Replace(_T("\""),_T("\\""));
strFormat.Format(_T(" -subject \"%s\""),strTmp);
strContent += strFormat;
}
}
if (tData.lpBody != NULL)
{
strTmp = tData.lpBody;
if (!strTmp.IsEmpty())
{
strTmp.Replace(_T("\""),_T("\\""));
strFormat.Format(_T(" -body \"%s\""),strTmp);
strContent += strFormat;
}
}
if (Run(strContent))
{
return TMAIL_SUCCESS;
}
else
{
DWORD deError = GetLastError();
return (TMAIL_ERROR)deError;
}
return TMAIL_SUCCESS;
}
//发送彩信
TMAIL_ERROR CTmailPanel::SendMMS(TMAIL_DATA &tData)
{
if (tData.lpTo == NULL)
{
return TMAIL_PARAMETER_ERROR;
}
CString strContent,strTmp,strFormat;
更多精彩
赞助商链接