有赏!!!!!vc中有没收发e_mail的控件

neverdown 2001-09-19 01:59:19
vc中有没收发e_mail的控件
...全文
108 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
lookfar 2001-09-19
  • 打赏
  • 举报
回复
在MSDN中就有源代码,我这就有,如果大家急的话:
CWhatWereYouDoingDlg dlg1(this);
dlg1.m_strString = m_strWhatWereYouDoing;
if(dlg1.DoModal() == IDOK)
{
m_strWhatWereYouDoing = dlg1.m_strString;
HINSTANCE hMail = NULL;
hMail = ::LoadLibraryA("MAPI32.DLL");

if (hMail == NULL)
{
AfxMessageBox(AFX_IDP_FAILED_MAPI_LOAD);
return;
}
ASSERT(hMail != NULL);

ULONG (PASCAL *lpfnSendMail)(ULONG, ULONG, MapiMessage*, FLAGS, ULONG);
(FARPROC&)lpfnSendMail = GetProcAddress(hMail, "MAPISendMail");
if (lpfnSendMail == NULL)
{
AfxMessageBox(AFX_IDP_INVALID_MAPI_DLL);
return;
}
ASSERT(lpfnSendMail != NULL);

// make a recipient
MapiRecipDesc rec;

char szRName[] = "Clever Porgrammer";
char szRAddress[] = "SMTP:sendyourerrorsto@yourcompanynotmine.com";
memset(&rec, 0, sizeof(rec));
rec.ulRecipClass = MAPI_TO;
rec.lpszName = szRName;
rec.lpszAddress = szRAddress;

char szSubject[] = "An Exception has occurred";

// prepare the message -----------------------------------------------------

MapiMessage message;
memset(&message, 0, sizeof(message));

message.nRecipCount = 1;
message.lpRecips = &rec;
message.lpszSubject = szSubject;

CString s = m_strWhatWereYouDoing;
s += "\n";
PrepareErrorMessage(s);

message.lpszNoteText = s.GetBuffer(s.GetLength());

// prepare for modal dialog box
AfxGetApp()->EnableModeless(FALSE);
HWND hWndTop;
CWnd* pParentWnd = CWnd::GetSafeOwner(NULL, &hWndTop);

// some extra precautions are required to use MAPISendMail as it
// tends to enable the parent window in between dialogs (after
// the login dialog, but before the send note dialog).
pParentWnd->SetCapture();
::SetFocus(NULL);
pParentWnd->m_nFlags |= WF_STAYDISABLED;

int nError = lpfnSendMail(0, (ULONG)pParentWnd->GetSafeHwnd(),
&message, MAPI_LOGON_UI|MAPI_DIALOG, 0);
s.ReleaseBuffer();

// after returning from the MAPISendMail call, the window must
// be re-enabled and focus returned to the frame to undo the workaround
// done before the MAPI call.
::ReleaseCapture();
pParentWnd->m_nFlags &= ~WF_STAYDISABLED;

pParentWnd->EnableWindow(TRUE);
::SetActiveWindow(NULL);
pParentWnd->SetActiveWindow();
pParentWnd->SetFocus();
if (hWndTop != NULL)
::EnableWindow(hWndTop, TRUE);
AfxGetApp()->EnableModeless(TRUE);

if (nError != SUCCESS_SUCCESS &&
nError != MAPI_USER_ABORT && nError != MAPI_E_LOGIN_FAILURE)
{
AfxMessageBox(AFX_IDP_FAILED_MAPI_SEND);
}
::FreeLibrary(hMail);
}
我自己编了一个生成ADO表集类的软件,自动生成,类型自动转换,自动处理连接参数,有谁想要的话,请和我联系,sunhongwei@371.net
prog_st 2001-09-19
  • 打赏
  • 举报
回复
>never_down@sina.com发出!
tar 2001-09-19
  • 打赏
  • 举报
回复
到codeguru.com去找吧
neverdown 2001-09-19
  • 打赏
  • 举报
回复
st哥们
怎么还没收到你的例啊,急着给你加分呢
zhj_long 2001-09-19
  • 打赏
  • 举报
回复
: prog_st(st) 
我请客,
给我来一个:zhj_long@sohu.com
neverdown 2001-09-19
  • 打赏
  • 举报
回复
豪爽! never_down@sina.com
a_kun 2001-09-19
  • 打赏
  • 举报
回复
a_kun@etang.com

也给我一个,谢谢!!!
prog_st 2001-09-19
  • 打赏
  • 举报
回复
控件没有,也不是VC开发的手段。
可以给你例程,Email!

16,551

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Creator Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧