使用GoDaddy的帐户发送电子邮件帐户、发送电子邮件、GoDaddy

2023-09-02 23:46:58 作者:最繁华时最悲凉

我想用我的GoDaddy的主机发送电子邮件。

我也送人了用户名和密码(你可以在code见)为测试电子邮件帐户,如果任何人有足够的时间,他们可以尝试和发送使用这些设置的电子邮件?我完全在砖墙。

我有雷鸟设置和它连接并发送精美使用下面的设置电子邮件,但是当我运行这个peice的的code,它只是超时。如果雷鸟可以发送电子邮件到该服务器,那么它必须是我的code。这真是令人沮丧。

  SmtpClient SS =新SmtpClient();

尝试 {
  ss.Host =smtpout.secureserver.net;
  ss.Port = 465;
  ss.Timeout = 10000;
  ss.DeliveryMethod = SmtpDeliveryMethod.Network;
  ss.UseDefaultCredentials = FALSE;
  ss.Credentials =新的NetworkCredential(testingaccount@comicidolonline.com,ABC123,comicidolonline.com);
  ss.EnableSsl = TRUE;

  MailMessage MAILMSG =新MailMessage(testingaccount@comicidolonline.com,youremail@youremail.com,主题在这里,我的身体);
  mailMsg.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
  ss.Send(MAILMSG);

  Console.WriteLine(发送的电子邮件);
  Console.ReadKey();
}
 

解决方案

既然你问如何发送电子邮件,它不能与System.Net.Mail(因为SSL问题)派,一种选择是使用aspNetEmail(这是我写的 - 所以这部分是一个无耻的插头)。我不知道任何开源电子邮件组件可以做到这一点,提供所需的SSL连接。

下面是一些code(只是测试,和它的作品)。

  EmailMessage M =新EmailMessage();
m.LogPath =C:\\ email.log;
m.Logging = TRUE;

m.Server =smtpout.secureserver.net;
m.Port = 465;
m.TimeOut = 10000;
m.Username =testingaccount@comicidolonline.com;
m.Password =ABC123;

m.From =testingaccount@comicidolonline.com;
m.To =youremail@youremail.com;
m.Subject =主题这里;
m.Body =我的身体;

AdvancedIntellect.Ssl.SslSocket SSL =新AdvancedIntellect.Ssl.SslSocket();
//加载SSL套接字,但告诉它连接*之前* 220欢迎响应
m.LoadSslSocket(SSL,真正的);

m.Send();
Console.WriteLine(发送的电子邮件);
 
GoDaddy邮件群发功能设置教程

如果你想尝试aspNetEmail,随意从下载最新版本的更新 链接文本

您还需要一个免费评估许可,您可以从中获取: 链接文本

如果您有任何疑问,请随时离线ping通我。

(在后来的编辑更多信息添加) 我找不到MSDN上的一部开拓创新的文档,我想的(它是一个数年)。但这里是从丹·巴格利一个MSDN博客文章。 http://blogs.msdn.com/webdav_101/archive/2008/06/02/system-net-mail-with-ssl-to-authenticate-against-port-465.aspx

System.Net.Mail使用SSL来验证口465 发送使用System.Net.Mail使用SSL邮件会失败:

  System.Net.NetworkCredential aCred =新System.Net.NetworkCredential(myacct,输入mypassword);

SmtpClient SMTP =新SmtpClient(smtp.mail.myserver.com,465);
smtp.EnableSsl = TRUE;
smtp.UseDefaultCredentials = FALSE;
smtp.Credentials = aCred;
 

System.Net.Mail只支持显式SSL。

显式SSL

System.Net.Mail只支持显式SSL。显式SSL开始在端口25上的未加密,然后发出STARTDLS并切换到加密连接。参见RFC 2228。

明确SLL会去是这样的:连接25 - >启动TLS(开始加密) - >验证 - >发送数据

如果SMTP服务器预计从一开始SSL / TLS连接,那么这将无法工作。

隐式SSL

有没有办法使用隐式SSL(SMTPS)与System.Net.Mail。隐式SSL会对整个连接被包裹在一个SSL层。特定的端口将被用于(端口465是常见的)。有没有正式的RFC覆盖隐式SSL。

隐SLL会去是这样的:启动SSL(加密启动) - >连接 - >验证 - >发送数据

这不被视为一个错误,这是一个功能要求。有两种类型的SMTP SSL认证的,我们只支持一个(设计) - 明确SSL

I'm trying to send an email using my godaddy hosting.

I've also given away the username and password (as you can see in the code) for the testing email account so if anyone has the time, can they try and send an email using these settings? I'm totally at a brick wall.

I've got Thunderbird setup and it connects and sends emails fine using the settings below, but when I run this peice of code, it just times out. If Thunderbird can send email to this server then it must be my code. It's really frustrating.

SmtpClient ss = new SmtpClient();

try {
  ss.Host = "smtpout.secureserver.net";
  ss.Port = 465;
  ss.Timeout = 10000;
  ss.DeliveryMethod = SmtpDeliveryMethod.Network;
  ss.UseDefaultCredentials = false;
  ss.Credentials = new NetworkCredential("testingaccount@comicidolonline.com", "abc123", "comicidolonline.com");
  ss.EnableSsl = true;

  MailMessage mailMsg = new MailMessage("testingaccount@comicidolonline.com", "youremail@youremail.com", "subject here", "my body");
  mailMsg.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
  ss.Send(mailMsg);

  Console.WriteLine("Sent email");
  Console.ReadKey();
}

解决方案

Since you are asking how to send email, and it can't be sent with System.Net.Mail (because of the SSL issue), one option is to use aspNetEmail (something I wrote -- so this is partially a shameless plug). I'm not aware of any open source email component that can do this, with the SSL connection required.

Here is some code (just tested, and it works).

EmailMessage m = new EmailMessage();
m.LogPath = "c:\\email.log";
m.Logging = true;

m.Server = "smtpout.secureserver.net";                    
m.Port = 465;                    
m.TimeOut = 10000;                    
m.Username = "testingaccount@comicidolonline.com";
m.Password = "abc123";            

m.From ="testingaccount@comicidolonline.com";
m.To = "youremail@youremail.com";
m.Subject = "subject here";
m.Body = "my body";                    

AdvancedIntellect.Ssl.SslSocket ssl = new AdvancedIntellect.Ssl.SslSocket();
//load the SSL socket, but tell it to connect *before* the 220 Welcome response
m.LoadSslSocket( ssl, true );

m.Send();                    
Console.WriteLine("Sent email");  

If you want to try aspNetEmail, feel free to download the latest build update from link text

You will also need a free eval license, which you can get from: link text

If you have any other questions, feel free to ping me offline.

(more info added during later edit) I couldn't find the orignal doc on MSDN that I was thinking of (it's been a few years). But here is a MSDN blog post from Dan Bagley. http://blogs.msdn.com/webdav_101/archive/2008/06/02/system-net-mail-with-ssl-to-authenticate-against-port-465.aspx

System.Net.Mail with SSL to authenticate against port 465 Sending mail using System.Net.Mail with SSL will fail:

System.Net.NetworkCredential aCred = new System.Net.NetworkCredential("myacct", "mypassword");

SmtpClient smtp = new SmtpClient("smtp.mail.myserver.com", 465);
smtp.EnableSsl = true;
smtp.UseDefaultCredentials = false;
smtp.Credentials = aCred;

System.Net.Mail only supports "Explicit SSL".

Explicit SSL

System.Net.Mail only supports "Explicit SSL". Explicit SSL starts as unencrypted on port 25, then issues a STARTDLS and switches to an Encrypted connection. See RFC 2228.

Explicit SLL would go something like: Connect on 25 -> StartTLS (starts to encrypt) -> authenticate -> send data

If the SMTP server expects SSL/TLS connection right from the start then this will not work.

Implicit SSL

There is no way to use Implicit SSL (SMTPS) with System.Net.Mail. Implicit SSL would have the entire connection is wrapped in an SSL layer. A specific port would be used (port 465 is common). There is no formal RFC covering Implicit SSL.

Implicit SLL would go something like: Start SSL (start encryption) -> Connect -> Authenticate -> send data

This is not considered a bug, it’s a feature request. There are two types of SSL authentication for SMTP, and we only support one (by design) – Explicit SSL.