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. orecle触发器

    一.触发器简介 触发器的定义就是说某个条件成立的时候,触发器里面所定义的语句就会被自动的执行.因此触发器不需要人为的去调用,也不能调用.然后,触发器的触发条件其实在你定义的时候就已经设定好了.这里面需 ...

  2. 利用war包和Tomcat镜像创建Web镜像

      from hub.c.163.com/library/tomcat:tag #代表以tomcat镜像为基础 MAINTAINER huhuixin 18611551449@163.com #代表所 ...

  3. PAT1077. Kuchiguse (20)

    #include <iostream> #include <vector> #include <sstream> using namespace std; int ...

  4. Java 获取路径的几种方法 - 转载

    1.获取当前类所在的“项目名路径” String rootPath = System.getProperty("user.dir"); 2.获取编译文件“jar包路径”(反射) S ...

  5. windows远程登录最大连接数

  6. Hibernate -- 映射多对多双向关联关系

    1. 示例代码: Student.java package cn.itcast.many2many; import java.util.HashSet; import java.util.Set; @ ...

  7. ASC和字符转化,整形和String转化

    public class ASCTest { public static void main(String[] args) { /* 区别这两种 String s = "123"; ...

  8. 去除掉myeclipse2017页面右上角的图片

    图标如下所示,这是方便测试用的,但是有时候也很碍人. 在servers中进行关闭,操作如下所示: 点击图中的CodeLive就可以使图标消失,再次点击图标会再次出现.

  9. WPF 自定义依赖属性

      原博客地址:http://www.cnblogs.com/DebugLZQ/archive/2012/11/30/2796021.html    DependencyObject和Dependen ...

  10. Ajax基础(一)--创建请求

    浏览器创建ajax请求: 1.如果是Firefox.Opera.Safari等高级浏览器,可使用XMLHttpRequest()方式创建一个新的ajax请求对象. 如果是IE浏览器,则使用Active ...