2

私は BlueHost を持っていますが、これを C# で動作させることができません。ログインしたページから詳細を取り出しました。

ここに画像の説明を入力

次に、このコードを使用してメールを送信しようとします。

MailMessage message = new MailMessage
{
    From = new MailAddress("toEmail@site.com", "toEmail@site.com")
};
message.IsBodyHtml = false;
message.To.Add("email@site.com");
message.Subject = "my subject";
message.Body = "body";
message.Priority = MailPriority.Normal;
SmtpClient client = new SmtpClient
{
    Port = 465,
    Host = "box263.bluehost.com",
    EnableSsl = true,
    Credentials = new NetworkCredential("myEmail@site.com", "myPassword"),
    Timeout = 10000,
    UseDefaultCredentials = false
};
client.Send(message);

十分な時間 (10 秒) があるにもかかわらず、タイムアウトというエラーがスローされます。タイムアウト時間を設定しなくても、しばらくそのままです。また、SSL を使用せずに「EnableSsl」を無効にし、ポートを「26」に変更し、ホストを「mail.embirk.com」に変更してみましたが、これもうまくいきません。また、これは Microsoft Outlook などのサードパーティ ソフトウェアでも動作します。何か案は?ありがとう。

編集: Bluehost のレベル II サポート技術者にも連絡しましたが、彼らも困惑しているとのことでした。彼らは、Thunderbird で試してみたところ、すべてうまくいったとのことでした。彼らはそれが証明書を探しているかもしれないと言いましたか?

編集2:

この Outlook レジストリが役に立ちますか。(実行した場合、これは Outlook で動作します)。

REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Office\Outlook\OMI Account Manager\Accounts\steve@embirk.com]
"DCEmail"=dword:00000002
"IMAP Server"="box263.bluehost.com"
"IMAP Port"=dword:000003e1
"SMTP Server"="box263.bluehost.com"
"SMTP Port"=dword:000001d1
"Connection Type"=dword:00000003
"IMAP User Name"="steve@embirk.com"
"SMTP Display Name"="steve@embirk.com"
"SMTP Email Address"="steve@embirk.com"
"SMTP Reply To Email Address"="steve@embirk.com"
"SMTP Organization Name"=""
"Account Name"="steve@embirk.com"
"IMAP Timeout"=dword:0000003c
"SMTP Timeout"=dword:0000003c
"IMAP Secure Connection"=dword:00000001
"IMAP Skip Account"=dword:00000000
"IMAP Prompt for Password"=dword:00000001
"SMTP User Name"="steve@embirk.com"
"SMTP Use Sicily"=dword:00000002
"SMTP Secure Connection"=dword:00000001
"SMTP Split Messages"=dword:00000000
"SMTP Prompt for Password"=dword:00000000
"IMAP Root Folder"=""
"IMAP Polling"=dword:00000001
"IMAP Poll All Folders"=dword:00000001
"IMAP Dirty"=dword:00000000
4

1 に答える 1

0

クライアント ブロックの外側で資格情報を宣言し、それをクライアント資格情報に割り当てようとします。

実際にブロックを完全に取り除きます。

NetworkCredential myCred = new NetworkCredential("xxxxxxxx", "xxxxxxxx");


client.Credentials = myCred;
client.port = 465,
client.Host = "box263.bluehost.com",
client.EnableSsl = true,
client.Credentials = new NetworkCredential("myEmail@site.com", "myPassword"),
client.Timeout = 10000,
client.UseDefaultCredentials = false
于 2012-05-07T20:02:51.763 に答える