Chilkat----开源网站之VS2010 CKMailMan一个非常好的邮件发送开源开发包
来源:互联网 发布:csp绘画软件mac 编辑:程序博客网 时间:2024/06/09 00:07
而它支持的平台则有:
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、创建一个测试工程:
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一个非常好的邮件发送开源开发包
- 一个 非常好的网站
- c++ 利用 chilkat 库发送 html邮件
- 一个非常好的网站!非常适合html开发的初学者
- 分享一个非常好的网站
- 一个简单的邮件发送开发
- 开发网站邮件发送模块
- web开发 开发一个能发送邮件的应用
- 一个非常好的技术方面的网站
- 【推荐】:一个非常好的下书的网站
- 学习ELK的一个非常好的网站
- 一个非常好的管理资料下载网站
- 分享一个非常好的网站及论坛
- 一个非常好的MATLAB学习网站
- 朋友介绍的一个购物网站,非常好!!!
- 分享一个非常好用的网站
- 一个非常好的JQuery中文文档网站
- 一个非常好的工具软件网站,小众软件
- Android L采用全新设计语言 Google Design
- MSP430学习收获
- 电脑眼睛保护色
- WebConfig配置文件详解
- OpenCV_轮廓的查找、表达、绘制、特性及匹配
- Chilkat----开源网站之VS2010 CKMailMan一个非常好的邮件发送开源开发包
- Android Socket网络编程 TCP协议
- ECSHOP二次开发之给商品增加新字段
- 如何防止僵尸进程的产生之fork两次
- C#学习笔记第二篇之标识符、关键字、基本数据类型
- PAX工作记录
- XSS之xssprotect
- CRC16校验原理总结
- 谷歌字体(Google Font)初探 [翻译自Google官方文档]