Nicht senden können E-Mails auf server. Erste exception, Die der SMTP-server erfordert eine sichere Verbindung oder der client wurde nicht authentifiziert

Jungs, ich habe eine Klasse wo ich bin, eine mail an alle Schüler in der Datenbank.Beim versenden von mails auf meinem lokalen host-mails senden leicht, aber wenn ich meine Dateien hochladen-code an den server. Ich bekomme diese exception :

System.Net.E-Mail.SmtpException: Der SMTP-server erfordert eine sichere
Verbindung oder der client wurde nicht authentifiziert. Die server-Antwort
war: 5.5.1 Authentifizierung Erforderlich. Erfahren Sie mehr bei
System.Net.E-Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode,
String response) bei System.Net.E-Mail.MailCommand.Senden(SmtpConnection
conn, Byte [] - Befehl, Mailadresse (Mail-alias aus, Boolean allowUnicode) bei
System.Net.E-Mail.SmtpTransport.SendMail(MailAddress Absender,
MailAddressCollection Empfänger, String deliveryNotify, Boolean
allowUnicode, SmtpFailedRecipientException& Ausnahme) an
System.Net.E-Mail.SmtpClient.Send(MailMessage message) bei
HotelWeb.SMTPHelper.SendEmail(String Von, String FromDisplayName,
String To, String Cc, String Bcc String Subject, String Body, Boolean
SendMailInBackGround) in
e:\hostingspaces\ubi9009\ihmsgr.taqwatechnologies.net\wwwroot\App_Code\SMTPHelper.cs:Zeile
140 auf HotelWeb.MAILnSMS.sendBulkMail() in e:\

hostingspaces\ubi9009\ihmsgr.taqwatechnologies.net\wwwroot\App_Code\MAILnSMS.cs:Zeile 95

Mein code funktioniert auf der lokalen Maschine, sondern doestnt Arbeit auf dem server ist wie folgt :

public static void sendBulkMail()
{

        _ds = new DataSet();



        SMTPBAL smtpbl = new SMTPBAL(0);
        smtpbl.LoadAll(_ds);

        string server = _ds.Tables[smtpbl.SqlEntityX].Rows[0]["SMTPX"].ToString();
        int smtpPort = WebHelper.Cast(_ds.Tables[smtpbl.SqlEntityX].Rows[0]["smtpPort"].ToString(), 0);
        string From = _ds.Tables[smtpbl.SqlEntityX].Rows[0]["Email"].ToString();
        string User = _ds.Tables[smtpbl.SqlEntityX].Rows[0]["User"].ToString();
        string Password = _ds.Tables[smtpbl.SqlEntityX].Rows[0]["Password"].ToString();
        string sDisclaimer = _ds.Tables[smtpbl.SqlEntityX].Rows[0]["Disclaimer"].ToString();
        bool EnableSSl = WebHelper.Cast(_ds.Tables[smtpbl.SqlEntityX].Rows[0]["EnableSll"], false);
        string EmailAddress = string.Empty;

        StudentBAL _stbl = new StudentBAL(0);
        _stbl.LoadAll(_ds);

        foreach (DataRow dr in _ds.Tables[_stbl.SqlEntityX].Rows)
        {
            try
            {
                if (dr["Email"] != DBNull.Value)
                {
                    if (IsValidMailAddress(dr["Email"].ToString()))
                    {
                        string Message = "Dear parent,<br/><br/> <br/> The Attendance for current course/semester of your ward," + dr["Name"].ToString() + " is available on the given below link.Please check and contact HOD in case any enquiry.<br/><br/><br/>Copy below link to your browsers address bar. <br/><br/>http://ihmsgr.taqwatechnologies.net/login/login.aspx <br/>User Name :" + dr["LoginEmailAddress"].ToString() + " /" + dr["EmailAddress"].ToString() + "<br/>Password : " + dr["Password"].ToString() + "<br/><br/><br/>Regard's<br/><br/>Institute of hotel management.<br/>Srinagar.";


                        SMTPHelper SMTP1 = new SMTPHelper(server, smtpPort, From, Password, EnableSSl, true);
                        SMTP1.IsHTML = true;

                        SMTP1.SendEmail(From, "Institute of hotel management", dr["Email"].ToString(), "", "", "Attendance status of your ward.", Message, false);
                    }
                }
            }
            catch (Exception err) {


            }

        }

    }

Ich bin mit hosting-Speicherplatz auf Server http://www.arvixe.com/ BITTE HELFEN

InformationsquelleAutor user3563009 | 2014-05-07
Schreibe einen Kommentar