Sending mail

What did you find when you looked for yourself? There are plenty of examples out there. What do you not understand about them? Look first and ask questions later. If you have an actual issue when you try to implement what you've found, that would be the time to post, including details of the specific issue.
 
I Was Try This Code....But Its Not Working Properly...
    Private Sub btn_send_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_send.Click
        Try
            Dim Smtp_Server As New SmtpClient
            Dim e_mail As New MailMessage()
            Smtp_Server.UseDefaultCredentials = False
            Smtp_Server.Credentials = New Net.NetworkCredential("username@gmail.com", "password")
            Smtp_Server.Port = 587
            Smtp_Server.EnableSsl = True
            Smtp_Server.Host = "smtp.gmail.com"
            e_mail = New MailMessage()
            e_mail.From = New MailAddress(txtfid.Text)
            e_mail.To.Add(txttid.Text)
            e_mail.Subject = "Email Sending"
            e_mail.IsBodyHtml = False
            e_mail.Body = txtmsg.Text
            Smtp_Server.Send(e_mail)
            MsgBox("Mail Sent")
        Catch error_t As Exception
            MsgBox(error_t.ToString)
        End Try
    End Sub
 
Last edited by a moderator:
If you know it's not working then you obviously have an expectation of what should happen and the reality is different from that. What are you expectations and the reality? Give us that information and then we know what we are looking for instead of trying to work out something that you already know.
 
Sending Mail

I was create a vb.net program for sending an E-mail to a gmail account.
I gave the From Id,To Id,and the Message.
when I click the SEND Button,it Produce the "System.Net.Mail.SmtpException:Failure Sending Mail" error,but I import the System.Net.Mail...

Please give some solution to overcome this error.
 
Back
Top