资源简介
邮件收发都写在,MyEmailClient
具体方法请看SMTP,POP3,Base64收发加密等内容,
下载即可运行

代码片段和文件信息
// AppOctetStream.cpp: implementation of the CAppOctetStream class.
// Author: Wes Clyburn (clyburnw@enmu.edu)
//////////////////////////////////////////////////////////////////////
#include “stdafx.h“
#include “AppOctetStream.h“
#include “base64.h“
#include “MIMEMessage.h“
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
// IMPORTANT: The number of bytes we read must be
// a multiple of 3 because Cbase64‘s Encode()
// method will append padding characters (‘=‘)
// to make the output‘s size a multiple of 4.
// (base64 treats 3 8-bit bytes as 4 6-bit ‘bytes‘).
// MIME decoders are free to treat ‘=‘ as a signal
// that there‘s no more data so we don‘t want to pad
// until we‘re supposed to.
// When at the end of the file the # of bytes read
// may not be a multiple of 3 but that‘s okay
// because we DO want the padding chars then.
#define BYTES_TO_READ 54 // This number guarantess output won‘t
// won‘t exceed line-length limit
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CAppOctetStream::CAppOctetStream( int nContentType )
:CMIMEContentAgent( nContentType )
{
}
CAppOctetStream::~CAppOctetStream()
{
}
BOOL CAppOctetStream::AppendPart(LPCTSTR szContent
LPCTSTR szParameters
int nEncoding
BOOL bPath
CString & sDestination)
{
CStdioFile fAttachment;
ASSERT( szContent != NULL );
// This class handles only file attachments so
// it ignores the bPath parameter.
if( szContent == NULL )
return FALSE;
if( !fAttachment.Open( szContent (CFile::modeRead | CFile::shareDenyWrite | CFile::typeBinary) ) )
return FALSE;
sDestination += build_sub_header( szContent
szParameters
nEncoding
TRUE );
attach_file( &fAttachment CMIMEMessage::base64 sDestination );
fAttachment.Close();
return TRUE;
}
CString CAppOctetStream::build_sub_header(LPCTSTR szContent
LPCTSTR szParameters
int nEncoding
BOOL bPath)
{
CString sSubHeader;
CString sTemp;
TCHAR szFName[ _MAX_FNAME ];
TCHAR szExt[ _MAX_EXT ];
_tsplitpath( szContent NULL NULL szFName szExt );
// This class ignores szParameters and nEncoding.
// It controls its own parameters and only handles
// base64 encoding.
if( bPath )
sTemp.Format( “; file=%s%s“ szFName szExt );
else
sTemp = _T( ““ );
sSubHeader.Format( _T( “Content-Type: %s%s\r\n“ )
(LPCTSTR)GetContentTypeString()
(LPCTSTR)sTemp );
sSubHeader += _T( “Content-Transfer-Encoding: base64\r\n“ );
sTemp.Format( _T( “Content-Disposition: attachment; filename=%s%s\r\n“ )
szFName szExt );
sSubHeader += sTemp;
// Signal end of sub-header.
sSubHeader += _T( “\r\n“ ); // Warning: numerous concatenation
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2010-07-11 12:34 完成\
文件 4279 2010-07-06 15:04 完成\AppOctetStream.cpp
文件 1239 1998-12-15 18:31 完成\AppOctetStream.h
文件 3867 2010-07-04 23:44 完成\ba
文件 1113 1998-12-15 18:31 完成\ba
文件 296448 2000-11-06 20:03 完成\CodeExchange.exe
目录 0 2010-07-11 12:34 完成\Debug\
文件 19883 2010-07-07 10:26 完成\Debug\AppOctetStream.obj
文件 0 2010-07-07 10:26 完成\Debug\AppOctetStream.sbr
文件 14854 2010-07-07 10:26 完成\Debug\ba
文件 0 2010-07-07 10:26 完成\Debug\ba
文件 68115 2010-07-07 10:26 完成\Debug\MailMessage.obj
文件 0 2010-07-07 10:26 完成\Debug\MailMessage.sbr
文件 4530 2010-07-07 10:26 完成\Debug\MIMECode.obj
文件 0 2010-07-07 10:26 完成\Debug\MIMECode.sbr
文件 5292 2010-07-07 10:26 完成\Debug\MIMEContentAgent.obj
文件 0 2010-07-07 10:26 完成\Debug\MIMEContentAgent.sbr
文件 71262 2010-07-07 10:26 完成\Debug\MIMEMessage.obj
文件 0 2010-07-07 10:26 完成\Debug\MIMEMessage.sbr
文件 5612544 2010-07-08 10:56 完成\Debug\MyEmailClient.bsc
文件 2003064 2010-07-08 10:58 完成\Debug\MyEmailClient.exe
文件 368400 2010-07-08 10:58 完成\Debug\MyEmailClient.ilk
文件 17164 2010-07-07 22:47 完成\Debug\MyEmailClient.obj
文件 7195324 2010-07-07 10:26 完成\Debug\MyEmailClient.pch
文件 648192 2010-07-08 10:58 完成\Debug\MyEmailClient.pdb
文件 1519588 2010-07-08 10:58 完成\Debug\MyEmailClient.res
文件 0 2010-07-07 22:47 完成\Debug\MyEmailClient.sbr
文件 54397 2010-07-08 10:56 完成\Debug\MyEmailClientDlg.obj
文件 0 2010-07-08 10:56 完成\Debug\MyEmailClientDlg.sbr
文件 33335 2010-07-07 10:26 完成\Debug\POP3.obj
文件 0 2010-07-07 10:26 完成\Debug\POP3.sbr
............此处省略45个文件信息
相关资源
- 国际象棋的qt源代码
- C++中头文件与源文件的作用详解
- 基于mfc的多线程文件传输
- C++多线程网络编程Socket
- VC++ 多线程文件读写操作
- 利用C++哈希表的方法实现电话号码查
- 移木块游戏,可以自编自玩,vc6.0编写
- C++纯文字DOS超小RPG游戏
- MFC数字钟(基于VC6.0)
- VC++MFC小游戏实例教程(实例)+MFC类库
- 连铸温度场计算程序(C++)
- 6自由度机器人运动学正反解C++程序
- Em算法(使用C++编写)
- libstdc++-4.4.7-4.el6.i686.rpm
- VC++实现CMD命令执行与获得返回信息
- 白话C++(全)
- C++标准库第1、2
- 大数类c++大数类
- C++语言编写串口调试助手
- c++素数筛选法
- C++ mqtt 用法
- ChartCtrl控件库(可在VS2019中使用)
- 商品库存管理系统 C++ MFC
- c++ 多功能计算器
- C++17 In Detail
- 嵌入式QtC++编程课件
- 颜色识别形状识别STM103嵌入式代码
- c++ 邮件多附件群发
- c++ 透明代理(hookproxy)
- mfc 调用redis
评论
共有 条评论