发送电子邮件与gmail smtp(安全层)在c ++ [英] sending email with gmail smtp ( secure layer ) in c++

查看:361
本文介绍了发送电子邮件与gmail smtp(安全层)在c ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,所有
任何一个成功与gmail smtp服务器? smtp.gmail.com
从c ++代码发送电子邮件?
i知道它使用安全层,但我不知道如何实现这样的。

Hello all does any one had success with gmail smtp servers ? smtp.gmail.com to send emails from c++ code ? i know its using secure layer but i have no idea how to implement such one .

推荐答案

,这是为linux的,但应该技术上在Windows上工作

This is what i used, It was for linux though, It should Technically work on windows


http://johnwiggins.net/jwsmtp/

教程在那里,straigt

The Tutorials are there and straigt forwards


http: //johnwiggins.net/jwsmtp/example1.html

这里是从网站复制和粘贴,显示端口和SMTP服务器。 Credit to john wiggins

Here is a copy and paste from the site showing Ports and SMTP Server. Credit goes to john wiggins

     jwsmtp::mailer mail(to.c_str( ),
                     from.c_str( ),
                     subject.c_str( ),
                     mailmessage.c_str( ),
                     smtpserver.c_str( ),
                     jwsmtp::mailer::SMTP_PORT,
                     false);

验证

mail.username("loginname");
mail.password("secret");
mail.authtype(mailer::PLAIN);

目前只支持LOGIN和PLAIN认证,默认登录,
设置为PLAIN调用authtype函数

Currently only LOGIN and PLAIN authentication are supported, LOGIN by default, to set to PLAIN call the authtype function

这篇关于发送电子邮件与gmail smtp(安全层)在c ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆