first, i've discovered through trial and error that c# 4/.NET 4 has some serious limitations which are to me unexplainable.

Microsoft is not supporting SSL over port 465 in c# 4/.NET 4.

Microsoft only supports SSL on 587 through "STARTTLS".

i need to use 465/SSL because my mail server hMailServer does not support "STARTTLS".

i had hoped to use c# 4/.NET 4 out of the box ... i do not want to purchase any third party solutions.

what i would like to do is to craft my own solution for SMTP using SSL on port 465.

i'm guessing that i may have to use c# unmanaged code to make this happen.

any ideas?, please & thank you. rgds/gerry

References:

"configuring SSL confusion...", hMailServer forum thread.

MSDN: "SmtpClient.EnableSsl Property":
"An alternate connection method is where an SSL session is established up front before any protocol commands are sent. This connection method is sometimes called SMTP/SSL, SMTP over SSL, or SMTPS and by default uses port 465. This alternate connection method using SSL is not currently supported."

P.S.: i searched SO and Google and can find nothing directly relevant.

f you can, and if it still works ("This API is now obsolete"), you should be able to use SMTPS (SMTP with up-front SSL/TLS) using System.Web.Mail.MailMessage:

System.Web.Mail.MailMessage mailMsg = new System.Web.Mail.MailMessage();
// ...
mailMsg.Fields.Add
("http://schemas.microsoft.com/cdo/configuration/smtpusessl",
true);

Of course, the fact that this API is now obsolete in .Net 4 is not ideal. It probably still works in practice.

Failing that, you may have to rely on 3rd-part libraries or something like stunnel.

c# 4.0 - how to i SMTP with c# 4/.NET 4 to port 465/SSL (...的更多相关文章

  1. Could not connect to SMTP host: smtp.***.com, port: 465, response: -1

    背景 在使用javamail进行邮件发送的时候,报错: Could not connect to SMTP host: smtp.***.com, port: 465, response: -1 原因 ...

  2. 腾讯企业邮箱报错 "smtp.exmail.qq.com"port 465, isSSL false

    一.报错 "smtp.exmail.qq.com" port 465, isSSL false 通过网上搜索查询一些资料,推测是邮箱的配置出问题了. 二.修改邮箱配置 // 创建属 ...

  3. Could not connect to SMTP host: smtp.qq.com, port: 465, response: -1 SpringBoot发送邮件

    解决方案 换端口 QQ邮箱可以把端口换成587 设置属性 spring.mail.properties.mail.smtp.ssl.enable=true 原因 465端口是为SMTPS(SMTP-o ...

  4. 解决Yii2邮件发送问题(结果返回成功,但接收不到邮件)

    刚刚用了一下yii邮件发送功能,虽然结果返回成功,但接收不到邮件.配置文件代码如下: 'components' => [ 'db' => [ 'class' => 'yii\db\C ...

  5. Linux系统诊断必备技能之二:tcpdump抓包工具详解

    一.简述 TcpDump可以将网络中传送的数据包完全截获下来提供分析.它支持针对网络层.协议.主机.网络或端口的过滤,并提供and.or.not等逻辑语句来帮助你去掉无用的信息. Linux作为网络服 ...

  6. ELK日志系统使用说明

    数据探索 Elasticsearch具有强大的数据检索和分析同能,支持模糊.全文.过滤.管道等数据查询.对于日志型数据处理很有优势. 下图为KIbana的主页图,将逐步说明每一部分的功能: 依照图中的 ...

  7. Docker-compose Setup for Self-hosting Development & Deployment Tools

    Last week I wrote about my self-hosted Sentry install in 3 Docker containers. This week I want to br ...

  8. MongoDB and GUI 管理界面

    MongoDB https://www.mongodb.com/ MongoDB AtlasDatabase as a Service The best way to deploy, operate, ...

  9. Kindle:自动追更之发送邮件

    @echo off setlocal enabledelayedexpansion set from=Kindlekindle设置好信任的邮箱set pw=密码 set to=Kindle邮箱 cd ...

随机推荐

  1. Kafka:ZK+Kafka+Spark Streaming集群环境搭建(八)安装zookeeper-3.4.12

    如何搭建配置centos虚拟机请参考<Kafka:ZK+Kafka+Spark Streaming集群环境搭建(一)VMW安装四台CentOS,并实现本机与它们能交互,虚拟机内部实现可以上网.& ...

  2. Sql控制反转小尝试

    假想用配置Sql语句的方式来完毕一个处理逻辑,而且映射到一个Url,这样当请求这个url的时候,运行前面配置的sql. 以下的一段详细配置,比如 当请求pagerlistdept.do的时候,会传入參 ...

  3. hadoop hue切换中文版

    搭建了Hue之后发现只有英文的界面,非常不开心,于是百度谷歌了一大堆也没有发现可靠的办法,就自己上手了一把,亲测可行. 英文版: 中文版: hue切换使用中文版的方法如下: 1.修改配置文件 vi / ...

  4. log4j和web.xml配置webAppRootKey 的问题(一个tomcat下部署多个应用)

    转自:http://blog.csdn.net/arvin_qx/article/details/6829873 在tomcat下部署两个或多个项目时,web.xml文件中最好定义webAppRoot ...

  5. maven 配置篇 之pom.xml

    http://www.blogjava.net/zyl/archive/2006/12/30/91055.html http://maven.apache.org/pom.html的翻译.     m ...

  6. 造轮子 | 怎样设计一个面向协议的 iOS 网络请求库

    近期开源了一个面向协议设计的网络请求库 MBNetwork,基于 Alamofire 和 ObjectMapper 实现,目的是简化业务层的网络请求操作. 须要干些啥 对于大部分 App 而言,业务层 ...

  7. iOS9 Error Domain=NSURLErrorDomain Code=-1022 App Transport Security (ATS)

    iOS 9在HTTP 访问时会出错  iOS9 Error Domain=NSURLErrorDomain Code=-1022 这时需要修改info.plist 文件 在Info.plist中添加N ...

  8. 微软BI 之SSRS 系列 - 使用带参数的 MDX 查询实现一个分组聚合功能的报表

    基于数据仓库上的 SSRS 报表展示,一般可以直接通过 SQL 查询,存储过程,视图或者表等多种方式将数据加载并呈现在报表中.但是如果是基于 Cube 多维数据集的数据查询,就不能再使用 SQL 的语 ...

  9. 微软BI 之SSRS 系列 - 在 Cube 中通过 MDX 查询实现基于父子递归关系的汇总报表

    之前我写了一篇在 SSRS 开发中处理这种父子关系的汇总与聚合的文章 (SSRS 系列 - 使用分组 Group 属性实现基于父子递归关系的汇总报表),示例中的查询是基于 SQL Server 关系型 ...

  10. 使用Spring框架入门二:基于注解+XML配置的IOC/DI的使用

    一.简述 本文主要讲使用注解+xml配合使用的几种使用方式.基础课程请看前一节. 二.步骤 1.为Pom.xml中引入依赖:本例中使用的是spring-context包,引入此包时系统会自动导入它的依 ...