17-12-15, 05:41 PM
Imports System.Net.Mail
Public Class Form1
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Dim email As New MailMessage()
Dim attachment As System.Net.Mail.Attachment
Try
email.From = New MailAddress("امايل المرسال هنا ")
email.To.Add("امايل المستقبل هنا")
email.Body = نص الرسالة
Dim smtp As New SmtpClient("سرفر الامايل")
smtp.Port = 25
smtp.EnableSsl = True
smtp.Credentials = New System.Net.NetworkCredential("your address mail here", "كلمة السر للامايل")
attachment = New System.Net.Mail.Attachment("امتداد الملف المراد ارساله") 'file path
email.Attachments.Add(attachment)
smtp.Send(email)
Catch ex As Exception
End Try
End Sub
Public Class Form1
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Dim email As New MailMessage()
Dim attachment As System.Net.Mail.Attachment
Try
email.From = New MailAddress("امايل المرسال هنا ")
email.To.Add("امايل المستقبل هنا")
email.Body = نص الرسالة
Dim smtp As New SmtpClient("سرفر الامايل")
smtp.Port = 25
smtp.EnableSsl = True
smtp.Credentials = New System.Net.NetworkCredential("your address mail here", "كلمة السر للامايل")
attachment = New System.Net.Mail.Attachment("امتداد الملف المراد ارساله") 'file path
email.Attachments.Add(attachment)
smtp.Send(email)
Catch ex As Exception
End Try
End Sub