hotmail开放了pop3,可以使用客户端工具收取邮件了。

POP 服务器: pop3.live.com (端口 995)
需要 POP SSL?: 是的
用户名: Windows Live ID, 比如:livesino@hotmail.com
密码: 对应 Windows Live ID 的密码
SMTP 服务器: smtp.live.com (端口 25)
需要身份验证?: 是的
需要 TLS/SSL?: 是的

使用indy,需要SSL认证,到网上查阅 ,看到了Marco Cantù的文章:

Send mail to GMail using Indy

Once you've moved your email accounts to GMail (or even entire domains), you have to fix the code you use in your Delphi programs for generating and sending email automatically. In fact, GMail uses the SMTP protocol for sending email, but with a specific form of SSH encryption called TLS.

To make things even more complicated, different clients use different ports and configurations. In particular, Outlook (which providees no TLS support) has different settings. For Indy, you can follow the settings used by other client programs, like those provided for Thunderbird. More info on the various ports in this newsgroup post:

Gmail uses 25, 465 and 587 for SMTP, but since almost all isps block 25, 465 is the preferred SMTP with SSL for gmail, and 587 is the preferred SMTP with TLS port.

Here is the code of a demo program, with the DFM file and the actual Delphi code (which is the same you'd generally use):

  object IdSMTP1: TIdSMTP
OnStatus = IdSMTP1Status
IOHandler = IdSSLIOHandlerSocketOpenSSL1
Host = 'smtp.gmail.com'
Password = '***'
Port = 587
SASLMechanisms = <>
UseTLS = utUseExplicitTLS
Username = '****'
end
object IdSSLIOHandlerSocketOpenSSL1: TIdSSLIOHandlerSocketOpenSSL
Destination = 'smtp.gmail.com:587'
Host = 'smtp.gmail.com'
MaxLineAction = maException
Port = 587
SSLOptions.Method = sslvTLSv1
SSLOptions.Mode = sslmUnassigned
SSLOptions.VerifyMode = []
SSLOptions.VerifyDepth = 0
OnStatusInfo = IdSSLIOHandlerSocketOpenSSL1StatusInfo
end
      IdSMTP1.Connect;
IdSMTP1.Send(IdMessage1);
IdSMTP1.Disconnect;

Where IdMessage1 is the message you want to send. Of course, you can both send messages to your gmail account or to any other account from you GMail account.

Notice: If you don't use "explicit TLS" you'll have to make extra initialization calls (like: IdSMTP1.SendCmd('STARTTLS', 220);). Finally, the IdSSLIOHandlerSocketOpenSSL1StatusInfo event handler produces a report like this:

      SSL status: "before/connect initialization"
SSL status: "before/connect initialization"
SSL status: "SSLv3 write client hello A"
SSL status: "SSLv3 read server hello A"
SSL status: "SSLv3 read server certificate A"
SSL status: "SSLv3 read server done A"
SSL status: "SSLv3 write client key exchange A"
SSL status: "SSLv3 write change cipher spec A"
SSL status: "SSLv3 write finished A"
SSL status: "SSLv3 flush data"
SSL status: "SSLv3 read finished A"
SSL status: "SSL negotiation finished successfully"
status: "SSL negotiation finished successfully"
Cipher: name = [...]; description = [...] SSLv3 Kx=RSA Au=RSA Enc=3DES(168)

我没有测试gmail,连接hotmail,出错,后来反复尝试,将idpop的useTLS属性改为utUseImplicitTLS就顺利通过了。

注意:SSL需要下载DLL支持:

http://www.indyproject.org/Sockets/SSL.EN.aspx

Indy10收发Hotmail邮件的更多相关文章

  1. 在Office Outlook 2013中收发QQ邮件

    选择手动配置 选择第三项 点击More Settings,在Outgoing  Server 勾选 如下 确认后,按下一步完成配置,此时会弹出对话框进行邮件发送测试.

  2. hotmail邮箱pop3server设置方法

    hotmail邮箱 的POP3/SMTP功能仅仅向Hotmail Plus的用户开放,普通用户想要使用这一功能的话,得进行一些特别的设置.如今这一功能总算面向全部的用户开放了,虽然微软官方还没宣布这一 ...

  3. EDM博主笔记:EDM邮件营销的几个细节问题

    其实说起EDM邮件营销很多做过的人都知道,目前国内邮件营销的效果其实是比较差的,为什么?因为国内没有多少使用邮件的习惯,如果不是工作所需估计很多的人都几天不碰邮件了,但是反观国外 邮件是其日常的一部分 ...

  4. 分享一些免费的,开源的邮件server软件

    因为企业的须要,我们非常可能须要架设一个邮件server,微软的Exchange太复杂?GOOGLE出来的又收费!头大了吧,OK,贾芸斐在这里给大家分享推荐几个免费的开源的邮件server软件.希望你 ...

  5. 分享几个免费的开源邮件server软件

    因为企业的须要,我们非常可能须要架设一个邮件server,微软的Exchange太复杂?GOOGLE出来的又收费!头大了吧,OK,贾芸斐在这里给大家分享推荐几个免费的开源的邮件server软件.希望你 ...

  6. U-Mail邮件营销可视化编辑设计邮件模板so easy

    相信每位看过军事演习的朋友都知道,现代战争越来越就像一场沙盘演练,真正做到了“运筹帷幄之中决战千里之外”,后方坐镇指挥战斗的能够将前线战场变得透明,这就叫“可视化战争”,做到了<孙子兵法> ...

  7. pop协议,邮件密码嗅探 使用说明

    思路与源代码 可以查看 https://www.cnblogs.com/likehc/p/10140174.html 因为软件用的是Wincap,所以 第一步安装下 WinPcap 第二步,打开 sn ...

  8. RDIFramework.NET敏捷开发框架Web新增邮件中心实现便捷式的邮件收发

    1.引言 邮件收发在很多业务系统中都有这样的需求,是比较正式和常用的功能.在我们的框架中提供了邮件中心功能模块,集内部邮件的收发.邮件归类.邮件星标的标记.邮件的删除与彻底删除等,邮件中心功能模块界面 ...

  9. Linux中限制用户邮件的大小

    Linux系统使用sendmail发送邮件,配置文件是/etc/sendmail.cf,缺省使用TCP/IP协议. 我们的Linux机器上往往会有多个用户同时工作,或者干脆就用它作邮件服务器,在同一时 ...

随机推荐

  1. Sql Server 日期时间格式转换

    日期数据格式的处理,两个示例: CONVERT(varchar(16), 时间一, 20) 结果:2007-02-01 08:02 CONVERT(varchar(10), 时间一, 23) 结果:2 ...

  2. eclipse部署的web项目没有添加到Tomcat的webapps目录下解决方法

    eclipse没有像myeclipse那样,添加web项目时会自动部署到Tomcat的webapps目录下. 而是部署到了eclipse的.metadata\.plugins\org.eclipse. ...

  3. codevs 1017 乘积最大 dp

    1017 乘积最大 时间限制: 1 s 空间限制: 128000 KB         题目描述 Description 今年是国际数学联盟确定的“2000——世界数学年”,又恰逢我国著名数学家华罗庚 ...

  4. scala学习手记19 - Option类型

    看到Option类型就知道这本教材应该要说那个了. 使用过guava后,应该知道guava中的Optional类的作用是什么.算了找下原始文档好了: Optional<T> is a wa ...

  5. Object有哪些方法?

    有9个方法 1 clone 2 toString() 3 getClass 4 finalize 5 equals 6 hascode 7 notify 8 notifall 9 wait

  6. Python 导出数据from Mysql

    环境 Anaconda3 Python 3.6, Window 64bit 目的 从MySQL数据库读取目标表数据,并处理 代码 # -*- coding: utf-8 -*- import pand ...

  7. 分享知识-快乐自己:FastDFS详解

    在使用fdfs之前,需要对其有一定的了解,这篇文章作为准备篇,将针对fdfs的简介,功能性,使用场景等方面进行介绍 一):起源 淘宝网开放平台技术部资深架构师余庆先生首先回顾了自己在Yahoo工作时的 ...

  8. appium自动化测试(二)

    一. 获取应用包名和入口activity 获取应用包名和入口activity:aapt命令 aapt目录: 安卓sdk的build-tools目录下(如果要在cmd里直接运行,要配置环境变量,否则需要 ...

  9. 列出远程git的全部分支

    列出全部分支 git ls-remote --heads your.git | awk 'sub(/refs\/heads\//,""){print $2}' 其中awk中sub替 ...

  10. 【scala】基础类型

    基础类型                              位数 Boolean                                 - Byte                 ...