邮件问题,散分

chary8088 2009-11-17 03:56:27
业余时间编写了一个 发邮件的类库,跨平台windows ,Linux都能用;
支持smtp协议,SSL链接;接口简单,丰富;
提供 发邮件函数,批量添加收件人,批量添加附件等接口
提供两个回调函数接口和虚函数接口,一个接口用于获取程序的从连接服务器到退出时的实时信息,
gmail(SSL 128位加密),
QQ(SSL 128位加密),
QQ(普通),
sina,
sohu,
21cn,
tom,
163(07年以前的)都可以发送
支持附件发送
支持HTML正文
支持信纸(背景图片)
跨平台 windows Linux都可以用

想请大家讨论下,这个东西用途?
做监控,把信息发到邮箱
还有什么?????比较好
...全文
1032 78 打赏 收藏 转发到动态 举报
写回复
用AI写文章
78 条回复
切换为时间正序
请发表友善的回复…
发表回复
chary8088 2011-05-29
  • 打赏
  • 举报
回复
chary8088 2010-01-07
  • 打赏
  • 举报
回复
http://u.115.com/file/f4935d521e

已经开发出程序,请大家使用
beefliu 2010-01-05
  • 打赏
  • 举报
回复
接分
vividand 2010-01-05
  • 打赏
  • 举报
回复
大家共享 越做越好
chary8088 2009-12-30
  • 打赏
  • 举报
回复
兼职还可以考虑。。短消息给我
16645709@qq.com[Quote=引用 74 楼 wangchentangjuan 的回复:]
我把我们公司的邮件地址发给你 你用邮件轰炸到我们公司求饶 它就会高薪聘请你了
[/Quote]
wangchentangjuan 2009-12-30
  • 打赏
  • 举报
回复
我把我们公司的邮件地址发给你 你用邮件轰炸到我们公司求饶 它就会高薪聘请你了
Eleven 2009-12-30
  • 打赏
  • 举报
回复
jf
  • 打赏
  • 举报
回复
LZ好强大啊,支持开源哈哈
lpygsc 2009-12-30
  • 打赏
  • 举报
回复
out look is not good , so it may be another "out look"!
哈利路亚1874 2009-12-30
  • 打赏
  • 举报
回复
来了就还是留个脚印!
这不是鸭头 2009-12-30
  • 打赏
  • 举报
回复
说到腾讯,就让人想起抄袭别人的创意...
zhangxun2007 2009-12-18
  • 打赏
  • 举报
回复
学习中...
yangxxxxxx66 2009-12-18
  • 打赏
  • 举报
回复
接了它
pengsheng1988 2009-12-18
  • 打赏
  • 举报
回复
学习,jf
cyrus_zhou 2009-12-18
  • 打赏
  • 举报
回复
up
chary8088 2009-11-18
  • 打赏
  • 举报
回复

/*--------------------------------------------------------------
* File : SendMail.h
* Author : libo QQ:16645709
* Date : 2008.6.14--2009.11
* Vesion : V 01.00.009
* Comment : 一个smtp邮件发送类
* Function: can send attachments, can distinguish show straight matter or text in 163
* History: 修改了显示进度不正确的问题
* 2008.11.12: 修改显示发送进度的函数名SMailSendProgress,
* 2008.12.01: 增加显示连接,发送命令,发送内容等信息的函数
* 2009.09.18: 修改发送协议,减少了与服务器的认证时间
* 2009.09.18: 增加发送HTML文件的能力
* 2009.09.18: 增加显示实时信息和显示发送进度的回调函数
*------------------------------------------------------------*/

#if !defined __SENDMAIL_H__
#define __SENDMAIL_H__

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#ifdef WIN32
#include <windows.h>
#endif

#include <sys/stat.h>
#include <time.h>
#include <iostream>
#include <vector>

#include ".\\communicate\\communicate.h"//网络通信类

using namespace std;

typedef void (*SMailInfoPtr)(const char* apInfo);// 实时信息回调
typedef void (*SMailProPtr)(const int& aiProgress, const int& aiTotalSize);//进度显示回调


class CSendMail //协议类
{
public:
CSendMail();
virtual ~CSendMail();
bool SendData(const char *apName, const char* apFromAddr, const char* apPassword, const char* apSubject, const char* apContent, const char* apHtml= NULL);
bool SendData(const char *apName, const char* apServer, const char* apUser, const char* apPassword, const char* apFromAddr, const char* apSubject, const char* apContent, const char* apHtml= NULL);
int AddAttachment(const char *apFile);//添加附件
int AddReceive(const char* apToAddr);//添加收件人
char *GetErrMsg(); //获取错误信息
void SetBcc(); //密送
void SetSSL(); //SSL连接
void SetSmtpPort(const int &aiPort); //port
void SetInfoCallBack(SMailInfoPtr aMailPtr);//实时信息回调函数设置,传入方式
void SetProgCallBack(SMailProPtr aMailPro);//进度大小回调函数设置

private:
/************************************************************************/
/* brief: connect the mail server
/* param mailServer: Mail server name that is domain name not ip*/
/************************************************************************/
int ConnectServer(const char* apMailServer);

/************************************************************************/
/* brief: send the content
/* param: content pointer*/
/************************************************************************/
void SendContent(const char *apDataContent, const char *apHtmlContent = NULL);

/************************************************************************/
/* brief: send the attachment
/* param filename: file name*/
/************************************************************************/
bool SendAffix(const char *apFilename);
bool SendContentFile(const char *apFilename, const int&aiContentID);
/************************************************************************/
/* brief: send the basic information
/* param Name: Name which is the name of send mail
/* param username: mail address name, such as xxxx, which is login name of xxxx@163.com
/* param password: mail password
/* param fromaddr: send the mail name , for example xxxx@163.com */
/* param toaddr: receive the mail address
/* param subject: the subject of the mail
/************************************************************************/
bool SendCMD(const char *apName, const char*apUserName, const char*apPassword, const char* apFromaddr, const char*apSubject);

/************************************************************************/
/* brief: quit from the mail server */
/************************************************************************/
bool SendQuit();

/************************************************************************/
/* brief: get response from server after sent data */
/************************************************************************/
bool GetResponse(const char* apKey = NULL);
int CloseSocket(const int aiSocket);
virtual void SMailSendProgress(const int aiProgress, const int aiTotalSize);//进度信息回调函数设置,虚函数方式
virtual void SMailInfo(const char* apInfo)//实时信息回调函数设置,虚函数方式
{
}
void CheckContentFile(const char* apContent);

inline int ANSIToBase64(const char *szInANSI, int nInLen, char *szOutBase64, int nOutLen);

void RandString(char* apRandStr, const int&aiSize);

protected:
int ciSocket;
int ciPort;
int ciRet;
int ciTotalSize;
int ciCurPro;
char csRecv_data[1024];
char csFilename[1024];
char *cpSend_data;
char csBoundaryStart[64];
char csBoundaryEnd[64];
bool cbBcc;

vector<string>AttFile;
vector<string>cvReceive;
vector<string>cvContentFile;
vector<string>cvContentID;

SMailInfoPtr cSIptr;
SMailProPtr cProPtr;

Communicate *ccomptr;


};

#endif
forster 2009-11-18
  • 打赏
  • 举报
回复
流氓广告。。。
kobesff 2009-11-18
  • 打赏
  • 举报
回复
不懂,来接分的
jxpxyp 2009-11-18
  • 打赏
  • 举报
回复
jf
chary8088 2009-11-18
  • 打赏
  • 举报
回复
感谢大家的热情支持,这两天正做界面,估计一两天就可以让大家看看是什么效果了;outlook发送的功能,我的都有

抄送
密送
附件发送
HTML正文
信纸(背景图片)
加载更多回复(58)

64,649

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

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