基于VC++的邮件收发系统


电子邮件系统的工作原理及相关协议,并基于这些协议设计和开发了一个实用的邮件收发系统。用户运行软件后可以进行基本操作,邮件管理(邮件发送和邮件接收),用户管理(查询邮件和修改,查询、删除用户),用户可以发送或接收一个或多个带附件的邮件,也可以使用不同的SMTP或POP3服务器。
资源截图
代码片段和文件信息
// AccountSetDlg.cpp : implementation file
//

#include “stdafx.h“
#include “邮件收发管理系统.h“
#include “AccountSetDlg.h“
#include “String.h“
#include “Smtp.h“

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

extern CString strSmtpAddr strAccount    strPassword strSendfrom;
extern int intPort;
/////////////////////////////////////////////////////////////////////////////
// CAccountSetDlg dialog


CAccountSetDlg::CAccountSetDlg(CWnd* pParent /*=NULL*/)
: CDialog(CAccountSetDlg::IDD pParent)
{
//{{AFX_DATA_INIT(CAccountSetDlg)
m_port = 0;
//}}AFX_DATA_INIT
}


void CAccountSetDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAccountSetDlg)
DDX_Control(pDX IDC_OK m_button2);
DDX_Control(pDX IDC_BUTTON1 m_button1);
DDX_Control(pDX IDC_LIST_SMTP m_smtpList);
DDX_Text(pDX IDC_EDIT_PORT m_port);
//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CAccountSetDlg CDialog)
//{{AFX_MSG_MAP(CAccountSetDlg)
ON_BN_CLICKED(IDC_OK OnOk)
ON_BN_CLICKED(IDC_BUTTON1 OnButtonTest)
ON_NOTIFY(NM_RCLICK IDC_LIST_SMTP OnRclickListSmtp)
ON_COMMAND(ID_MENUITEM32778 OnMenuDelete)
ON_NOTIFY(NM_DBLCLK IDC_LIST_SMTP OnDblclkListSmtp)
ON_COMMAND(IDR_MENU_Add OnMENUAdd)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAccountSetDlg message handlers

void CAccountSetDlg::OnOk() 
{
// TODO: Add your control notification handler code here

CString portTemp;                       //用当前edit控件中内容进行测试
GetDlgItemText(IDC_EDIT_SMTP        strSmtpAddr);
GetDlgItemText(IDC_EDIT_PORT        portTemp);
GetDlgItemText(IDC_EDIT_ACCOUNT      strAccount);        
GetDlgItemText(IDC_EDIT_PWD     strPassword);         
GetDlgItemText(IDC_EDIT_SENDFROM     strSendfrom);

     if(strSmtpAddr.IsEmpty())
{
AfxMessageBox(“请填写smtp服务器地址!“); 
return ;
}
if(portTemp.IsEmpty())
{
AfxMessageBox(“请填写smtp服务器端口号!“); 
return ;
}
if(strAccount.IsEmpty())
{
AfxMessageBox(“请填写帐号!“); 
return ;
}
if(strPassword.IsEmpty())
{
AfxMessageBox(“请填写密码“); 
return ;
}
if(strSendfrom.IsEmpty())
{
AfxMessageBox(“请填写发送地址!“); 
return ;
}

CString  totalTemp;
// portTemp.Format(“%d“intPort);
    
  //写入系统默认smtp设置文件

FILE *pSetFile=fopen(“smtpSet.txt““w“);
totalTemp=strSmtpAddr+“#&“+portTemp+“#&“+strAccount+“#&“+strPassword+“#&“+strSendfrom+“#&“;
fwrite(totalTemp1strlen(totalTemp)pSetFile);
 
fclose(pSetFile);
     //写入smtp配置文件夹
CString path;

     
path=“smtpList/“+strSmtpAddr+“.txt“;
    pSetFile=fopen(path“w“);
totalTemp=strSmtpAddr+“#&“+portTemp+“#&“+strAccount+“#&“+strPassword+“#&“+strSendfrom+“#&“;
fwrite(totalTemp1strlen(totalTemp)pSetFile);
 
fclose(pSetFile);
m_smtpList.DeleteAllItems();
OpenFile();

MessageBox(“设置成功“);
 /*  m_smtpList.InsertItem(00);
m_smtpList

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-05-14 15:32  基于vc++的邮件收发系统
     文件       13166  2009-06-30 22:05  基于vc++的邮件收发系统AccountSetDlg.cpp
     文件        1703  2009-06-30 22:04  基于vc++的邮件收发系统AccountSetDlg.h
     目录           0  2012-05-19 16:38  基于vc++的邮件收发系统AttFiles
     文件         580  2009-06-25 09:33  基于vc++的邮件收发系统AttFilesl2.lic
     文件        3236  2009-06-04 09:34  基于vc++的邮件收发系统ase.cpp
     文件         908  2009-06-04 10:27  基于vc++的邮件收发系统ase.h
     目录           0  2012-05-19 16:38  基于vc++的邮件收发系统communication
     文件        6974  2009-07-01 10:24  基于vc++的邮件收发系统Communication.cpp
     文件        1464  2009-07-01 09:44  基于vc++的邮件收发系统Communication.h
     文件          60  2009-06-12 20:48  基于vc++的邮件收发系统communication.txt
     文件          20  2009-06-13 10:21  基于vc++的邮件收发系统communication22212121
     文件          33  2009-06-14 21:09  基于vc++的邮件收发系统communicationBREEZE.txt
     文件          37  2009-06-24 16:22  基于vc++的邮件收发系统communicationJincoKK.txt
     文件          25  2009-06-24 16:15  基于vc++的邮件收发系统communicationLGS.txt
     文件        3250  2009-06-13 18:05  基于vc++的邮件收发系统CustomButton.cpp
     文件        1456  2009-06-13 18:05  基于vc++的邮件收发系统CustomButton.h
     目录           0  2013-05-14 15:32  基于vc++的邮件收发系统Debug
     文件      109312  2013-05-14 15:32  基于vc++的邮件收发系统DebugAccountSetDlg.obj
     文件      398896  2013-05-14 15:32  基于vc++的邮件收发系统DebugAccountSetDlg.sbr
     文件       36885  2013-05-14 15:32  基于vc++的邮件收发系统Debugase.obj
     文件      353326  2013-05-14 15:32  基于vc++的邮件收发系统Debugase.sbr
     文件       54414  2013-05-14 15:32  基于vc++的邮件收发系统DebugBuildLog.htm
     文件       57128  2013-05-14 15:32  基于vc++的邮件收发系统DebugCommunication.obj
     文件       11499  2013-05-14 15:32  基于vc++的邮件收发系统DebugCommunication.sbr
     文件       34569  2013-05-14 15:32  基于vc++的邮件收发系统DebugCustomButton.obj
     文件       23073  2013-05-14 15:32  基于vc++的邮件收发系统DebugCustomButton.sbr
     文件       55999  2013-05-14 15:32  基于vc++的邮件收发系统DebugDlgFold.obj
     文件       10834  2013-05-14 15:32  基于vc++的邮件收发系统DebugDlgFold.sbr
     文件       59629  2001-09-28 00:00  基于vc++的邮件收发系统Debugjmail.tlh
     文件       57389  2001-09-28 00:00  基于vc++的邮件收发系统Debugjmail.tli
............此处省略330个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)