资源简介
vc++做的邮件收发系统,供课程设计使用。仅供参考

代码片段和文件信息
// MailMessage.cpp: implementation of the CMailMessage class.
// Copyright (c) 1998 Wes Clyburn
// Download by http://www.codefans.net
// Modified to have Header and Body handling in this class rather than in any
// class that uses instances of CMailMessage.
// Copyright (c) 1998 Michael Krebs
//////////////////////////////////////////////////////////////////////
#include “stdafx.h“
#include “MailMessage.h“
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CMailMessage::CMailMessage()
{
m_sBody=_T(““);
m_sHeader=_T(““);
}
CMailMessage::~CMailMessage()
{
}
BOOL CMailMessage::AddRecipient( LPCTSTR szEmailAddress LPCTSTR szFriendlyName)
{
ASSERT( szEmailAddress != NULL );
ASSERT( szFriendlyName != NULL );
CRecipient to;
to.m_sEmailAddress = szEmailAddress;
to.m_sFriendlyName = szFriendlyName;
m_Recipients.Add( to );
return TRUE;
}
// sEmailAddress and sFriendlyName are OUTPUT parameters.
// If the function fails it will return FALSE and the OUTPUT
// parameters will not be touched.
BOOL CMailMessage::GetRecipient(CString & sEmailAddress CString & sFriendlyName int nIndex)
{
CRecipient to;
if( nIndex < 0 || nIndex > m_Recipients.GetUpperBound() )
return FALSE;
to = m_Recipients[ nIndex ];
sEmailAddress = to.m_sEmailAddress;
sFriendlyName = to.m_sFriendlyName;
return TRUE;
}
int CMailMessage::GetNumRecipients()
{
return m_Recipients.GetSize();
}
BOOL CMailMessage::AddMultipleRecipients(LPCTSTR szRecipients )
{
TCHAR* buf;
UINT pos;
UINT start;
CString sTemp;
CString sEmail;
CString sFriendly;
UINT length;
int nMark;
int nMark2;
ASSERT( szRecipients != NULL );
// Add Recipients
//
length = strlen( szRecipients );
buf = new TCHAR[ length + 1 ]; // Allocate a work area (don‘t touch parameter itself)
strcpy( buf szRecipients );
for( pos = 0 start = 0; pos <= length; pos++ )
{
if( buf[ pos ] == ‘;‘ ||
buf[ pos ] == 0 )
{
// First pick apart the sub-strings (separated by ‘;‘)
// Store it in sTemp.
//
buf[ pos ] = 0; // Redundant when at the end of string but who cares.
sTemp = &buf[ start ];
// Now divide the substring into friendly names and e-mail addresses.
//
nMark = sTemp.Find( ‘<‘ );
if( nMark >= 0 )
{
sFriendly = sTemp.Left( nMark );
nMark2 = sTemp.Find( ‘>‘ );
if( nMark2 < nMark )
{
delete[] buf;
return FALSE;
}
// End of mark at closing bracket or end of string
nMark2 > -1 ? nMark2 = nMark2 : nMark2 = sTemp.GetLength() - 1;
sEmail = sTemp.Mid( nMark + 1 nMark2 - (nMark + 1) );
}
else
{
sEmail = sTemp;
sFriendly = ““;
}
AddRecipient( sEmail sFriendly );
start = pos
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 57283 2014-06-18 18:46 收发送电子邮件\MyEmailClient\Debug\MailMessage.obj
文件 139354 2014-06-18 18:59 收发送电子邮件\MyEmailClient\Debug\MyEmailClient.exe
文件 281880 2014-06-18 18:59 收发送电子邮件\MyEmailClient\Debug\MyEmailClient.ilk
文件 15942 2014-06-18 18:46 收发送电子邮件\MyEmailClient\Debug\MyEmailClient.obj
文件 5567268 2014-06-18 18:46 收发送电子邮件\MyEmailClient\Debug\MyEmailClient.pch
文件 443392 2014-06-18 18:59 收发送电子邮件\MyEmailClient\Debug\MyEmailClient.pdb
文件 3284 2014-06-18 18:59 收发送电子邮件\MyEmailClient\Debug\MyEmailClient.res
文件 37620 2014-06-18 18:58 收发送电子邮件\MyEmailClient\Debug\MyEmailClientDlg.obj
文件 33078 2014-06-18 18:46 收发送电子邮件\MyEmailClient\Debug\POP3.obj
文件 29757 2014-06-18 18:46 收发送电子邮件\MyEmailClient\Debug\SMTP.obj
文件 106729 2014-06-18 18:46 收发送电子邮件\MyEmailClient\Debug\StdAfx.obj
文件 222208 2014-06-18 18:59 收发送电子邮件\MyEmailClient\Debug\vc60.idb
文件 364544 2014-06-18 18:58 收发送电子邮件\MyEmailClient\Debug\vc60.pdb
文件 7400 2010-04-16 21:48 收发送电子邮件\MyEmailClient\MailMessage.cpp
文件 1541 1998-11-30 02:07 收发送电子邮件\MyEmailClient\MailMessage.h
文件 37136 2014-06-18 18:59 收发送电子邮件\MyEmailClient\MyEmailClient.aps
文件 1872 2014-06-18 19:04 收发送电子邮件\MyEmailClient\MyEmailClient.clw
文件 2255 2002-06-27 08:46 收发送电子邮件\MyEmailClient\MyEmailClient.cpp
文件 4659 2002-06-27 09:50 收发送电子邮件\MyEmailClient\MyEmailClient.dsp
文件 551 2002-06-27 08:46 收发送电子邮件\MyEmailClient\MyEmailClient.dsw
文件 1437 2010-04-16 21:53 收发送电子邮件\MyEmailClient\MyEmailClient.h
文件 66560 2014-06-18 19:04 收发送电子邮件\MyEmailClient\MyEmailClient.ncb
文件 53760 2014-06-18 19:04 收发送电子邮件\MyEmailClient\MyEmailClient.opt
文件 987 2014-06-18 18:59 收发送电子邮件\MyEmailClient\MyEmailClient.plg
文件 6477 2014-06-18 18:59 收发送电子邮件\MyEmailClient\MyEmailClient.rc
文件 6258 2014-06-18 19:04 收发送电子邮件\MyEmailClient\MyEmailClientDlg.cpp
文件 1563 2002-06-27 09:10 收发送电子邮件\MyEmailClient\MyEmailClientDlg.h
文件 5342 2010-04-16 21:53 收发送电子邮件\MyEmailClient\POP3.cpp
文件 1760 1998-11-29 04:50 收发送电子邮件\MyEmailClient\POP3.h
文件 3705 2002-06-27 08:46 收发送电子邮件\MyEmailClient\ReadMe.txt
............此处省略14个文件信息
- 上一篇:虚拟火灾逃生模拟仿真系统
- 下一篇:多运动目标检测和跟踪
相关资源
- VC++ 多线程文件读写操作
- 移木块游戏,可以自编自玩,vc6.0编写
- VC++MFC小游戏实例教程(实例)+MFC类库
- VC++实现CMD命令执行与获得返回信息
- VC++基于OpenGL模拟的一个3维空间模型
- 基于VC++的SolidWorks二次开发SolidWorks
- 派克变换VC++源码(附文档)
- VC++ 串口
- VC++ 大富翁4_大富翁游戏源码
- VC++ 摄像头视频采集与回放源程序
- 转 VC++ 实现电子邮件(Email)发送
- 基于MFC的VC++仿QQ浏览器源码(雏形)
- VC++ 服务程序编写及安装与卸载
- VC++6.0番茄西红柿VAXvirsual assist X完美破
- 基于改进的fcm算法的图像分割vc++
- VC++6.0 绿色版,免安装,非常好用。
- Microsoft Visual C++ 2005 Redistributable Pack
- VC++MFC课程设计的学生成绩管理系统
- 大智慧365DLL插件设计
- VC++6.0汉化包
- VC++完整商业界面源码(再上传)
- VC++编程技术600个大型项目源码.rar
- VC++实现RSA加密算法
- VC++ 中国象棋经典游戏源代码
- 郁金香VC++游戏辅助视频教程
- C语言进阶源码---基于graphics实现图书
- 摄影测量相对定向VC++程序
- VC++数字图像处理典型算法及实现
- VC++酒店客房管理系统 MFC
- 车站计算机联锁vc++6.0程序代码
评论
共有 条评论