smtp

SmtpException: Unable to read data from the transport connection: net_io_connectionclosed

只愿长相守 提交于 2019-12-27 17:07:50
问题 I am using the SmtpClient library to send emails using the following: SmtpClient client = new SmtpClient(); client.Host = "hostname"; client.Port = 465; client.DeliveryMethod = SmtpDeliveryMethod.Network; client.UseDefaultCredentials = false; client.EnableSsl = true; client.Credentials = new NetworkCredential("User", "Pass); client.Send("from@hostname", "to@hostname", "Subject", "Body"); The code works fine in my test environment, but when I use production SMTP servers, the code fails with an

How can I make SMTP authenticated in C#

核能气质少年 提交于 2019-12-27 11:00:43
问题 I create new ASP.NET web application that use SMTP to send message. The problem is the smtp was not authenticated from who send the message. How can I make SMTP authenticated in my program? does C# have a class that have attribute for enter username and password? 回答1: using System.Net; using System.Net.Mail; using(SmtpClient smtpClient = new SmtpClient()) { var basicCredential = new NetworkCredential("username", "password"); using(MailMessage message = new MailMessage()) { MailAddress

ASP.NET 2.0中发送电子邮件

血红的双手。 提交于 2019-12-27 07:23:46
ASP.NET 2.0 中发送电子邮件变得非常简单。发送电子邮件的类库主要在命名空间 System.Net.Mail 中, 在这个命名空间中有两个核心类是: · MailMessage:描述一个电子邮件消息;它拥有From,To,Subject,Body等属性; · SmtpClient:把一个指定的MailMessage实例发送到一个指定的SMTP服务器。 发送电子邮件的一般步骤是: 1. 创建一个MailMessage对象; 2. 赋给它的From,To,Subject,Body等属性; 3. 创建一个SmtpClient类实例; 4. 指定关于使用该SMTP服务器的细节(如果它们没有在Web.config中指定); 5. 经由SmtpClient对象的Send方法发送该MailMessage。 下面的代码演示了发送电子邮件的过程: string mailServerName = " smtp.126.com " ; // 发送邮件的SMTP服务器 string mailFrom = " sender0624@126.com " ; // 发件人邮箱(用126的邮件服务器,就必须用126邮箱的用户名) string mailTo = " supremezone@126.com " ; // 收件人邮箱 string subject = " 用代码方式发送邮件 " ; //

(原创)python发送邮件

自闭症网瘾萝莉.ら 提交于 2019-12-27 07:19:32
这段时间一直在学习flask框架,看到flask扩展中有一个mail插件,所以今天就给大家演示如果发邮件。 首先我注册了一个163邮箱,需要开启smtp功能,因为咱们python发送邮件经过的是smtp.163.com(网易的电子邮件服务器)。 注册好163邮箱,然后开启smtp功能,如下图所示: 开启的过程中需要绑定手机。 我最终实现的样子是这样的: 使用flask搭建了一个web服务器,然后做了一个网页,将收件人,主题,正文填好之后,点击发送,上面会显示发送结果。 下面是整个工程的结构 : templates是存放了两个html文件,pyMail实现所有的功能。接下来我列一下源代码,然后将发送部分的核心代码进行讲解。 base.html: {% extends "bootstrap/base.html" %} {% block title %}Flasky {% endblock %} {% block navbar %} <div class="navbar navbar-inverse" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data

SMTP: Error 554, message is not RFC compliant [closed]

﹥>﹥吖頭↗ 提交于 2019-12-25 17:43:09
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . Our custom automatic email delivery service is hitting this problem with a couple of our clients' SMTP servers. It only happens with about three of them--the message is bounced back with the following response from the SMTP server: SMTP error from remote mail server after end of data: host clients.host.name [XXX

Change CakeEmail SMTP authentication type

 ̄綄美尐妖づ 提交于 2019-12-25 16:49:36
问题 How do you change the authentication type that CakeEmail uses when using Smtp transport? I get this error: SMTP Error: 504 5.7.4 Unrecognized authentication type when trying to send to a system that doesn't support Password authentication. It only supports NTLM. I haven't seen anything about setting the authentication type in the cookbook or API for CakePHP 2.5.1. Is there any way to manually change it? 回答1: CakePHPs SMTP transport only supports basic username/password authentication, there

Sending email via Powershell using secure password

不羁岁月 提交于 2019-12-25 15:18:45
问题 I'm trying to test sending an email but I don't want to just have a plaintext password in my script. Here's what I have, and this works: $SmtpServer = 'smtp.office365.com' $SmtpUser = 'fubsygamr@office365.com' $smtpPassword = 'Hunter2' $MailtTo = 'fubsygamr@office365.com' $MailFrom = 'fubsygamr@office365.com' $MailSubject = "Test using $SmtpServer" $Credentials = New-Object System.Management.Automation.PSCredential -ArgumentList $SmtpUser, $($smtpPassword | ConvertTo-SecureString -AsPlainText

Sending email via Powershell using secure password

梦想的初衷 提交于 2019-12-25 15:17:02
问题 I'm trying to test sending an email but I don't want to just have a plaintext password in my script. Here's what I have, and this works: $SmtpServer = 'smtp.office365.com' $SmtpUser = 'fubsygamr@office365.com' $smtpPassword = 'Hunter2' $MailtTo = 'fubsygamr@office365.com' $MailFrom = 'fubsygamr@office365.com' $MailSubject = "Test using $SmtpServer" $Credentials = New-Object System.Management.Automation.PSCredential -ArgumentList $SmtpUser, $($smtpPassword | ConvertTo-SecureString -AsPlainText

How do I connect to a fake SMTP server using Loopback

℡╲_俬逩灬. 提交于 2019-12-25 14:45:51
问题 This similar to to this question, but intstead I am trying to connect to this fake smtp-server https://www.npmjs.com/package/smtp-sink I run this server using npm i smtp-sink and smtp-sink and it seems fine Here is how I have configured my datasource: "emailDataSource": { "connector": "mail", "transports": [{ "type": "smtp", "host": "localhost", "secure": false, "port": 1025, "tls": { "rejectUnauthorized": false } }] } and sending the email through an endpoint as such: (this 9is inside a

Failure Sending Mail. Unable to connect to remote server. A socket operation

谁说胖子不能爱 提交于 2019-12-25 14:11:09
问题 So I'm trying to send an e-mail through VB.net code and I keep getting this error. I've disabled my firewall, and I can successfully send an e-mail when it's not getting the text from the textbox. I know that I have the right settings as it works when I send an e-mail with the body of 1 line. Private Sub SendMessage(ByVal SmtpHost As String, ByVal SmtpPort As Integer, ByVal ssl As Boolean, ByVal SmtpUsername As String, ByVal SmtpPassword As String, ByVal mail_from As String, ByVal display