locked
Problem in sending mail after upgrade to exchange 2007 RRS feed

  • Question

  • User-1791846068 posted

    I'm trying to send mail through Exchange 2007 but error comes saying "<title>Untitled Page</title> Syntax error, command unrecognized. The server response was: 5.7.3 Authentication unsuccessful. "

    Please help.

    The code is as follows:


    Imports System.net.Mail
    Imports System.IO
    Partial Class _Default
        Inherits System.Web.UI.Page

        Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
             Dim Mail As New MailMessage(New MailAddress("from_email_id", ""), New MailAddress("to_email_id"))
            Mail.IsBodyHtml = True
            Mail.Subject = "Test Mail"
            Mail.Body = "Dear Sir, <br><br>eMail Request is made for Creation <BR><BR>List of Officers who have applied for email creation at BR <br/><br><br> <BR> <BR> <BR> <font color = blue> <b>Please do not reply to this email. <BR>"
            Dim smtp As New SmtpClient("IP_OF_SERVER")
            Dim credentials As New System.Net.NetworkCredential("USERNAME", "PASSWORD", "DOMAIN")
            smtp.UseDefaultCredentials = False
            smtp.Port = 587
                 smtp.Credentials = credentials
            Try
                smtp.Send(Mail)
                Button1.Text = "OK"
            Catch ex As Exception
                Response.Write(ex.Message.ToString)
            End Try
        End Sub
       End Class

    Monday, November 23, 2009 6:23 AM

All replies

  • User-1659704165 posted

    Hi,

    error means "During the AUTH phase of the SMTP protocol conversation, the provided credentials were incorrect or the authenticated user doesn't have permission to submit to this server. "

    http://technet.microsoft.com/en-us/library/aa997170.aspx

    OR

    http://www.mcpblog.net/Lists/Posts/Post.aspx?List=8f2497f6-e77b-4e70-8400-e020b292165c&ID=47

    http://forums.msexchange.org/Using_C%23_to_send_an_email_over_exchange_server/m_1800502250/tm.htm

    http://stackoverflow.com/questions/444210/how-do-i-send-emails-outside-my-domain-with-exchange-2007-and-c

    OR

    //what R U trying is SMTP WAY OF SENDING Mail..

    http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.credentials.aspx

    Tuesday, November 24, 2009 1:41 AM