الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

كيف ارسل ايميل من داخل الفيجوال بيسك دوت نيت ...

بدأه Lead Monsters في 3 يونيو 2008 · 0 رد · 856 مشاهدة · في Microsoft Visual Basic.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1

الآن اصبح بأمكانك ان ترسل ايميل من داخل الفيجوال بيسك دوت نيت

قم بأستوراد المجالات التالية


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

شكراً لكم و اتمنى ردوداً

مواضيع مشابهة

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…