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. 解决Ubuntu/debian的Apt-get 由于依赖关系安装失败的问题

    The following packages have unmet dependencies: libssl-dev: Depends: libssl0.9.8 (= 0.9.8k-7ubuntu8) ...

  2. (C++)字符串分割

    题目: 如何对C++中输入的字符串进行分割呢?如“I am a student”,去除空格后分割成为“I”,“am”, “a”, “student”四个单词 思路: 直接参考代码 代码: void s ...

  3. C++ 纯虚方法

    1.纯虚方法解决什么样的问题,为什么要设计出纯虚方法? 考虑下面的需求,基类声明了一个方法,这个方法只针对具体的子类才有意义,比如Animal的Eat()方法,调用Animal的Eat方法是没有意义的 ...

  4. 用Jetty 9.1运行Java WebSockets微服务

    Jetty 9.1的发布将Java WebSockets (JSR-356) 带入了非Java EE环境,从而开启了微服务时代.我们可以将Jetty的容器包含在java应用程序中(注意,不是Java代 ...

  5. Android Studio 之 导入Eclipse项目常见问题及解决方案

    在将Eclipse做的Android项目成功导入Android Studio 后,启动生成,遇到一些问题,现总结如下: 问题1:图片命名问题 AS对图片命名要求比eclipse严格,图片名称只能有&q ...

  6. ACID、Data Replication、CAP与BASE

    ACID 在传数据库系统中,事务具有ACID 4个属性. (1) 原子性(Atomicity):事务是一个原子操作单元,其对数据的修改,要么全都执行,要么全都不执行. (2) 一致性(Consiste ...

  7. 透彻理解Ioc

    引述:IoC(控制反转:Inverse of Control)是Spring容器的内核,AOP.声明式事务等功能在此基础上开花结果.但是IoC这个重要的概念却比较晦涩隐讳,不容易让人望文生义,这不能不 ...

  8. Java继承Exception自定义异常类教程以及Javaweb中用Filter拦截并处理异常

    转载请注明原文地址:http://www.cnblogs.com/ygj0930/p/6403033.html 在项目中的应用见: https://github.com/ygj0930/CoupleS ...

  9. 【Fanvas技术解密】HTML5 canvas实现脏区重绘

    先说明一下,fanvas是笔者在企鹅公司开发的,即将开源的flash转canvas工具. 脏区重绘(dirty rectangle)并不是一门新鲜的技术了,这在最早2D游戏诞生的时候就已经存在. 复杂 ...

  10. Java通过join方法来暂停当前线程

    目标线程的join方法暂停当前线程,直到目前线程完成(从run()方法返回). Java代码: package Threads; import java.io.IOException; /** * C ...