Imports System.Net.Mail Imports System.Text Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button2.Click Dim email As New MailMessage Dim smtp As SmtpClient smtp = New SmtpClient("smtp.yandex.ru") smtp.Port = 587 smtp.Credentials = New Net.NetworkCredential("admin@yandex.ru", "") email.From = New MailAddress("admin@yandex.ru") email.To.Add(New MailAddress("SEVlasova@yandex.ru")) email.Body = "Post" ' body of the letter take the text (data from MS Word (doc or docx) email.Subject = "Post" email.Attachments.Add(New System.Net.Mail.Attachment("D:\files.txt")) smtp.Send(email) End Sub<pre>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)