Chilkat----开源站点之VS2010 CKMailMan一个很好的邮件发送开源开发包
Chilkat 是一个很好的开源站点,有各种开源库。
开发语言主要有Classic ASP •C
• C++ • C# • Delphi ActiveX • Delphi DLL • Visual FoxPro • Java • MFC • Objective-C • Perl • PHP ActiveX • PHP Extension • PowerShell • Python • Ruby • SQL Server • Unicode C • Unicode C++ • Visual Basic 6.0 • VB.NET • VBScript;
而它支持的平台则有:
Chilkat 主页:http://www.chilkatsoft.com/
开发包下载连接:http://www.chilkatsoft.com/downloads.asp 这里能够依据你的须要下载不同版本号的开发包。
以下我就以win7 x64 + VS2010 C/C++开发一个邮件发送程序样例,做个教程:
首先下载开发包:
一、打开开发包下载页面:http://www.chilkatsoft.com/downloads.asp
选择 Download Chilkat C / C++ Libraries,如图:
点击后进入了。http://www.chilkatsoft.com/downloads_CPP.asp。假设你的其它平台请自行选择,我的是windows 所以我选择例如以下:
点击进去后就是开发版本号的选择了,不要着急向下滑动,选择你须要的开发包。我的是VS2010 我的选择例如以下:
下载后。将他解压到一个目下。我解压到我的D盘,解压的文件有三个。include,libs,license.txt如图,
----------------------------------------------------------------------------------
二、接下来就是配置我们的VS2010了
过程例如以下:
1、创建一个測试project:
2、加入包括头文件,刚才解压在D盘还记得吗?呵呵:
3、加入lib库我这里拿ChilkatDbg.lib演示,还要加入其它的库哟!完整的例如以下
crypt32.lib
ws2_32.lib
D:\chilkat-9.5.0-x86-vc10\libs\ChilkatDbg.lib
3.加入实例代码。我这里直接贴出来:
//官网上关于邮件发送的说明文档连接:http://www.example-code.com/cpp/mht_emailHtmlFile.asp
//关于邮件开发文档:http://www.example-code.com/cpp/smtp.asp
//这里有很多开发样例。点击左边的选择框。就能看到不同方法,然后点击自己想要的样例就能够了。
//CKMailTest.cpp
#include "stdafx.h"
#include<stdio.h>
#include<stdlib.h>
#include "../include/CkMailMan.h"
#include "../include/CkEmail.h"
#include "../include/CkMht.h"
void ChilkatSample(void)
{
// The mailman object is used for sending and receiving email.
CkMailMan mailman; // Any string argument automatically begins the 30-day trial.
bool success;
success = mailman.UnlockComponent("30-day trial");
if (success != true) {
printf("%s\n",mailman.lastErrorText());
return;
} // Set the SMTP server.
mailman.put_SmtpHost("smtp.chilkatsoft.com"); // Set the SMTP login/password (if required)
mailman.put_SmtpUsername("myUsername");
mailman.put_SmtpPassword("myPassword"); // Create a new email object
CkEmail email; email.put_Subject("This is a test");
email.put_Body("This is a test");
email.put_From("Chilkat Support <support@chilkatsoft.com>");
email.AddTo("Chilkat Admin","admin@chilkatsoft.com");
// To add more recipients, call AddTo, AddCC, or AddBcc once per recipient. // Call SendEmail to connect to the SMTP server and send.
// The connection (i.e. session) to the SMTP server remains
// open so that subsequent SendEmail calls may use the
// same connection.
success = mailman.SendEmail(email);
if (success != true) {
printf("%s\n",mailman.lastErrorText());
return;
} // Some SMTP servers do not actually send the email until
// the connection is closed. In these cases, it is necessary to
// call CloseSmtpConnection for the mail to be sent.
// Most SMTP servers send the email immediately, and it is
// not required to close the connection. We'll close it here
// for the example:
success = mailman.CloseSmtpConnection();
if (success != true) {
printf("Connection to SMTP server not closed cleanly.\n");
} printf("Mail Sent!\n");
}
int _tmain(int argc, _TCHAR* argv[])
{
ChilkatSample();//直接调用
return 0;
}
Chilkat----开源站点之VS2010 CKMailMan一个很好的邮件发送开源开发包的更多相关文章
- 基于开源项目的在线网络视频直播项目---一个很好的电视直播开源项目Sopcast
http://blog.csdn.net/roy_xu/article/details/2216559 http://115.com/?ct=rar&pickcode=ew52634xr2cr ...
- 分享一个Fluent风格的邮件发送封装类
C#中用SmtpClient发邮件很简单,闲着无事,简单封装一下 IEmailFactory public interface IEmailFactory { IEmailFactory SetHos ...
- 一个很好的开源视频播放器GiraffePlayer2(支持rtmp,rtsp,http,https)
一个很好的开源视频播放器GiraffePlayer2(支持rtmp,rtsp,http,https) https://github.com/tcking/GiraffePlayer2 GiraffeP ...
- libCURL开源库在VS2010环境下编译安装,配置详解
libCURL开源库在VS2010环境下编译安装,配置详解 转自:http://my.oschina.net/u/1420791/blog/198247 http://blog.csdn.net/su ...
- Makefile经典教程(一个很棒很清晰的讲解)【转】
转自:https://blog.csdn.net/seven_amber/article/details/70216216 该篇文章为转载,是对原作者系列文章的总汇加上标注. 支持原创,请移步陈浩大神 ...
- Druid:一个用于大数据实时处理的开源分布式系统
Druid是一个用于大数据实时查询和分析的高容错.高性能开源分布式系统,旨在快速处理大规模的数据,并能够实现快速查询和分析.尤其是当发生代码部署.机器故障以及其他产品系统遇到宕机等情况时,Druid仍 ...
- 一个很cool的C#的高性能数学库
High Performance Math Library for C# and .NET是一个很cool的C#的高性能数学库,3D效果也很不错,下图是首页上的一个例子.他也有一个交互的网页,你可以自 ...
- FluentConsole是一个托管在github的C#开源组件
FluentConsole是一个托管在github的C#开源组件 阅读目录 1.控制台能有啥滑头? 2.FluentConsole基本介绍 3.使用介绍 4.资源 从该系列的第一篇文章 .NET平台开 ...
- 安利一个很火的 Github 滤镜项目
安利一个很火的 Github 滤镜项目 园长 1 个月前 简评:通过深度学习,一秒钟让你的照片高大上,这是康奈尔大学和 Adobe 的工程师合作的一个新项目,通过卷积神经网络把图片进行风格迁移.项目已 ...
随机推荐
- pymongo创建索引
from database import db db_list = ["table1", "table2", "table3", " ...
- 解决chrome运行报错unknown error: cannot get automation extension
今天把默认浏览器改成chrome,结果一运行脚本就报错,具体错误信息如下. FAILED CONFIGURATION: @BeforeClass beforeClassorg.openqa.selen ...
- elasticsearch6.3.2之x-pack6.3.2破解安装并配合kibana使用
原文链接:https://www.plaza4me.com/article/20180825223826278 由于在elasticsearch在6.3版本之后x-pack是默认安装好的,所以不再需要 ...
- vim 如何与外界粘贴复制
在学习使用vim 的过程序,我们知道在vim 里面,粘贴复制的命令是y/p ,但是我们总会碰到这样的问题:如何把vim 里面复制的内容粘贴到vim 之外或者把vim 外面复制的内容粘贴到vim 里面? ...
- android4.0后无法向Servlet发送请求解决办法
从4.0开始,强制性地规定网络堵塞任务都不能放在ui线程,不然直接报错. 个办法,在oncreate下面加入 StrictMode.setThreadPolicy(new StrictMode.Thr ...
- mysql 某字段插入随机数
UPDATE `表名` SET `字段名`=ceiling(rand()*500000+500000) WHERE (条件); 写入11位手机 UPDATE xm_user a SET a.user_ ...
- Java编程的逻辑 (2) - 赋值
本系列文章经补充和完善,已修订整理成书<Java编程的逻辑>,由机械工业出版社华章分社出版,于2018年1月上市热销,读者好评如潮!各大网店和书店有售,欢迎购买,京东自营链接:http:/ ...
- SprintBoot 1.2.8 入门
现在SpringBoot官网Quick Start的版本是1.5.3,试了一下,报错说我JDK版本太低,查了一下说是需要JDK8,所以我使用了旧版本1.2.8,实际上在POM中的依赖配置方式一样的. ...
- vue后台管理框架
vue后台管理框架 系列教程<一步步带你做vue后台管理框架>第一课 github地址:vue-framework-wz 线上体验地址:立即体验 在如今的科技公司中有很多前端的需求都是要写 ...
- 【BZOJ】4349: 最小树形图
题解 我们只考虑给每个点买一个,之后每个点就可以用最低价格买了 根据最小树形图的算法,就是不断给每个点入度的边找一条最小的 如果构成了树形图就退出,否则把形成了环的点缩成一个点,加上环的权值,然后把指 ...