VB 2008 ile email göndermek için kod var.Ancak dosya ekleme ozelligi yok nasıl yapabilirim.?? Tesekkurler şimdiden..
Private Sub messageSenderCode()
Try
Dim smtpServer As New SmtpClient()
Dim mail As New MailMessage()
'Username & Password to connect to the sending account (Gmail account)
smtpServer.Credentials = New Net.NetworkCredential(txtUsername.Text, txtPassword.Text)
'Using Gmail (settin all the details required)
smtpServer.Port = 587 'the gmail's port number
smtpServer.Host = "smtp.gmail.com" 'Gmail Smtp server
smtpServer.EnableSsl = True 'SSL Checker setn to true
mail = New MailMessage()
mail.From = New MailAddress(txtUsername.Text)
mail.To.Add(txtEmail.Text)
mail.Subject = txtSubject.Text 'setting the message subject
mail.Body = txtMessage.Text 'etting the body of the message
smtpServer.Send(mail)
MsgBox("Mail Sent to" & "--" & txtEmail.Text, ) 'this confirms that the message has been sent successfully
Catch ex As Exception
MsgBox(ex.Message) ' this code will throw an error if the code does not run successfully
End Try
End Sub