Immer eine ASP-Fehlermeldung: Mailbox nicht verfügbar. Die Serverantwort war: Zugriff verweigert - Ungültiger HELO-name (Siehe RFC2821 4.1.1.1)

Ich eine Fehlermeldung, und ich weiß, dass meine Anmeldedaten korrekt sind. Irgendwelche Ideen? Diese ist auf einem Windows-Server, aber ich bin nutzen wollen, die Hostgator SMTP-Einstellungen für mein E-Mail. Dies ist, was passiert, wenn ich Ihnen ein einfaches Kontaktformular.

FEHLER:
Postfach nicht verfügbar. Die Serverantwort war: Zugriff verweigert - Ungültiger HELO-name (Siehe RFC2821 4.1.1.1)

Beschreibung: Eine nicht behandelte Ausnahme ist aufgetreten während der Ausführung der aktuellen Webanforderung. Bitte überprüfen Sie die Stapelüberwachung für weitere Informationen über den Fehler und wo Sie Ihren Ursprung in den code.

Exception Details: System.Net.E-Mail.SmtpException: Postfach nicht verfügbar. Die Serverantwort war: Zugriff verweigert - Ungültiger HELO-name (Siehe RFC2821 4.1.1.1)

Quellfehler Zeile 61:

Line 59:            
Line 60:             SmtpClient smtp = new SmtpClient(SMTPServer, SMTPPort);
Line 61:             smtp.Credentials = new NetworkCredential(SMTPUserId, SMTPPassword);
Line 62:             smtp.Send(mail);
Line 63:         }

Quelle: File: \ \ Websites\Client\Berichte\ContactUs.aspx.cs Zeile: 61

=========================================================================

Mein Quellcode:

  protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        string name = txtFirstName.Text + " " + txtLastName.Text;
        string clientID = Session["CustomerID"].ToString();
        string message = txtMessage.Text;
        string email = txtEmail.Text;
        string company = txtCompany.Text;
        string phone = txtPhone.Text;

        SMTPMailHelper.SendMail(email, "[email protected]", "Contact from Client: " + clientID + ": " + name + " " + company, message);
    }

LIEß ICH EINIGE SKRIPT HAST, EGAL, WIE BEDINGTE ANWEISUNGEN.
UND DAS IST DER REST:

 public class SMTPMailHelper
{
    const string SMTPServer = "mail.mydomain.com";
    const string SMTPUserId = "[email protected]";
    const string SMTPPassword = "MyPasswordHidden";
    const int SMTPPort = 25;

    public static void SendMail(string sendFrom, string sendTo, string subject, string body)
    {
        MailAddress fromAddress = new MailAddress(sendFrom);
        MailAddress toAddress = new MailAddress(sendTo);
        MailMessage mail = new MailMessage();


        mail.From = fromAddress;
        mail.To.Add(toAddress);
        mail.Subject = subject;

        if (body.ToLower().Contains("<html>"))
        {
            mail.IsBodyHtml = true;
        }

        mail.Body = body;


        SmtpClient smtp = new SmtpClient(SMTPServer, SMTPPort);
        smtp.Credentials = new NetworkCredential(SMTPUserId, SMTPPassword);
        smtp.Send(mail);
    }
}
  • Mögliche Duplikate stackoverflow.com/questions/10828555/...
  • Nee, in die andere Frage, bekommt der user wieder ein "Failed to deliver" E-Mail-Nachricht. In dieser Frage hat, bekommt er eine exception in der Methode Send ().
InformationsquelleAutor user2593041 | 2014-07-25
Schreibe einen Kommentar