Tag: smtp

在GoDaddy上通过gmail SMTP发送电子邮件

这可能吗? 我可以通过localhost发送,但在godaddy上,电子邮件不会被发送。 有没有人设法实现这一目标? 我正在使用C#

我如何让TcpListener接受多个连接并单独使用每个连接?

我有一个运行良好的SMTP侦听器,但只能接收一个连接。 我的C#代码如下,我将其作为服务运行。 我的目标是让它在服务器上运行并解析发送给它的多个smtp消息。 目前它解析第一条消息并停止工作。 我怎样才能让它接受第2,第3,第4 …… SMTP消息并像第一个那样处理它? 这是我的代码: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net.Sockets; using System.Net; using System.IO; namespace SMTP_Listener { class Program { static void Main(string[] args) { TcpListener listener = new TcpListener(IPAddress.Any , 8000); TcpClient client; NetworkStream ns; listener.Start(); Console.WriteLine(“Awaiting connection…”); client = listener.AcceptTcpClient(); Console.WriteLine(“Connection accepted!”); ns = client.GetStream(); […]

如何通过Gmail发送带有C#的电子邮件

尝试通过我的Web服务发送电子邮件时收到错误。 我已尝试启用访问不太安全的应用程序,禁用两步validation并通过Web浏览器登录帐户。 SO的解决方案都没有对我有用。 我还在: 错误:System.Net.Mail.SmtpException:SMTP服务器需要安全连接或客户端未经过身份validation。 服务器响应为:5.5.1需要身份validation。 我该怎么做才能解决这个问题? namespace EmailService { public class Service1 : IService1 { public string SendEmail(string inputEmail, string subject, string body) { string returnString = “”; try { MailMessage email = new MailMessage(); SmtpClient smtp = new SmtpClient(); smtp.Host = “smtp.gmail.com”; // set up the Gmail server smtp.EnableSsl = true; smtp.Port = […]

在不安装SMTP服务器的情况下发送邮件

我有一个.Net应用程序。 我希望此应用程序向我发送电子邮件。 如何在不安装SMTP服务器的情况下实现此目的?

测试SMTP服务器正在通过C#运行

如何在不发送消息的情况下通过C#测试SMTP是否正常运行。 我当然可以尝试: try{ // send email to “nonsense@example.com” } catch { // log “smtp is down” } 必须有一个更整洁的方法来做到这一点。