الآن اصبح بأمكانك ان ترسل ايميل من داخل الفيجوال بيسك دوت نيت
قم بأستوراد المجالات التالية
Imports System.Net.Mail
Imports System.Net.Sockets
حدث الضغط على الزر او اي حدث ضع
Dim From As String = "myemail@myemail.com"
Dim UserName As String = "SMTP Server User Name"
Dim Password As String = "SMTP Server Password"
Dim SMTPServer As String = "www.MyWebSite.com"
Dim Security As Integer = "SMTP Server Security" ' هذا يكون نعم أو لا فقط
Dim ReceiverEmail As String = "someone@Email.com"
Dim Subject As String = "Enter a subject here"
Dim Text As String = "Email text here."
Dim mail As New MailMessage()
mail.From = New MailAddress(From)
mail.To.Add(ReceiverEmail)
'set the content
mail.Subject = Subject
mail.Body = Text
''specify the priority of the mail message
mail.Priority = MailPriority.High
Dim smtp As New SmtpClient(SMTPServer)
If Security = 1 Then
smtp.Credentials = New System.Net.NetworkCredential(UserName, Password)
End If
Try
smtp.Send(mail)
MsgBox("Message successfull send to user.", MsgBoxStyle.Information, "Email Utility")
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Mail Error")
End Try
Catch ex As Exception
MsgBox(ex.Message)
End Try
Try
شكراً لكم و اتمنى ردوداً