Hi,
I'm using the following code in vb.Net for sending a mail. Its sending the mail from my system. but not sending in the server machine. In the server machine, "Server responses 5.7.3 Authentication Unsuccessful" error comes. Where I've mistaken in the code. But the username and password are same.
Dim mail As New MailMessage()
Dim smtp As New SmtpClient("*** .***.com")
mail.From = New MailAddress("us ername@zxy-abs.com", "username")
mail.To.Add(txt To.Text)
mail.Subject = txtSubject.Text
mail.Body = rtxBody.Text
smtp.Credential s = New Net.NetworkCred ential("usernam e", "pwd")
Try
smtp.Send(mail)
MsgBox("sent")
Catch ex As Exception
MsgBox(ex.Messa ge)
End Try
Regards
Aravind
I'm using the following code in vb.Net for sending a mail. Its sending the mail from my system. but not sending in the server machine. In the server machine, "Server responses 5.7.3 Authentication Unsuccessful" error comes. Where I've mistaken in the code. But the username and password are same.
Dim mail As New MailMessage()
Dim smtp As New SmtpClient("*** .***.com")
mail.From = New MailAddress("us ername@zxy-abs.com", "username")
mail.To.Add(txt To.Text)
mail.Subject = txtSubject.Text
mail.Body = rtxBody.Text
smtp.Credential s = New Net.NetworkCred ential("usernam e", "pwd")
Try
smtp.Send(mail)
MsgBox("sent")
Catch ex As Exception
MsgBox(ex.Messa ge)
End Try
Regards
Aravind