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. 让你的Python代码更加pythonic

    http://wuzhiwei.net/be_pythonic/ 何为pythonic? pythonic如果翻译成中文的话就是很python.很+名词结构的用法在中国不少,比如:很娘,很国足,很CC ...

  2. spring 判断非空提示断言

    org.springframework.util.Assert Assert.notNull(object, "Bean object must not be null");

  3. Skyline开发4-IProject接口

    IProject接口可以访问工程设置和打开保存工程的基本方法. 属性 FileVersion:返回 ITEVersionInfo.表示当前运行的TerraExplorer的版本,可通过ITEVersi ...

  4. uni - 自定义组件

    目录结构如下 点击下载自定义组件示例

  5. Linux下验证码无法显示,Could not initialize class sun.awt.X1 解决方案

    环境:Oracle Linux 6.4,JDK1.6,Weblogic11g 在通过java.awt生成图片验证码时,提示: Could not initialize class sun.awt.X1 ...

  6. 提示“Resource temporarily unavailable”的原因及解决办法

    问题:Linux环境下编程时,在读串口时,出现"Resource temporarily unavailable"的错误提示. 原因:串口设置成了非阻塞模式,但是没有用select ...

  7. ajax 与springmvc交互返回数据

    1.controller将数据封装成json格式返回页面 @RequestMapping("/dataList") public void datalist(CsoftCunsto ...

  8. SQL Server connect to MySQL SQL Server通过LinkServer访问MySQL数据库,并操作mysql数据库代码

    SQL Server 中需要访问MySQL的数据,可以通过调用MySQL的ODBC驱动,在SQL Server中添加LinkServer的方式实现. 1.从MySQL网站下载最新的MySQL ODBC ...

  9. C#与Java同步加密解密DES算法

    在实际项目中,往往前端和后端使用不同的语言.比如使用C#开发客户端,使用Java开发服务器端.有时出于安全性考虑需要将字符加密传输后,由服务器解密获取.本文介绍一种采用DES算法的C#与Java同步加 ...

  10. ROS中利用V-rep进行地图构建仿真

    V-rep中显示激光扫描点  在VREP自带的场景中找到practicalPathPlanningDemo.ttt文件,删除场景中多余的物体只保留静态的地图.然后在Model browser→comp ...