Hi all.I am trying to send mail through my vb.net application but i am getting error "Failure sending mail."
Can any1 help me to solve this problem?Below is the code I have written.
Private Sub Send_Mail(ByVal SendTo As String, ByVal Subject As String, ByVal Body As String) Dim strFrom As String = "firstname.lastname@example.org" Dim strto As String = SendTo Dim strSubject As String = Subject Dim strbody As String = Body Dim smtp As SmtpClient = New SmtpClient() Dim msg As MailMessage = New MailMessage(strFrom, strto, strSubject, strbody) msg.IsBodyHtml = True smtp.Host = "localhost" smtp.Send(msg) MsgBox("Mail Sent.") End Sub
Edited 4 Years Ago by Rachna0309: text