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

سؤال: إرسال بريد الكتروني على بريد مدفوع

مغلق
بدأه maayah في 17 ديسمبر 2007 · 1 رد · 753 مشاهدة · في Microsoft Visual Basic.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ورحمة الله وبركاته

عندي بريد مدفوع الثمن على الياهو Yahoo وقد قمت

بعمل برنامج يرسل بريد الكتروني عن طريق الكود التالي:

Dim mail As New System.Net.Mail.MailMessage()

mail.From = New System.Net.Mail.MailAddress("me@mycompany.com")

mail.To.Add("you@yourcompany.com")

mail.Subject = "This is an email"

mail.Body = "this is the body content of the email."

Try

Dim smtp As New System.Net.Mail.SmtpClient("mail.yahoo.com", "25")

smtp.Send(mail)

MsgBox("Sent!")

Catch ex As Exception

MsgBox(ex.Message)

End Try

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

البريد الالكتروني المدفوع لكني لا اعرف كيف أضيف الكود الذي اضع

فيه كلمة السر واسم المستخدم. ارجو مساعدتي في طريقة اضافة هذا الكود.

مع شكري...

#2

اولا ادخل فوق المكتبة

system.net.mail

ثم اكتب الكود التالي :

Const googleMailPortNumber As Integer = 587

' Replace ???? with your username and password as appropiate

Const userName As String = "???????"

Const passWord As String = "???????"

Dim msgMail As MailMessage

Dim smtp As SmtpClient

'Example send email from self to self, just to show it works

msgMail = New MailMessage(userName, userName, "subject", "message body")

'Very important to use port 587 as port port 465 simply doesnt work with

'.NET smtp class

smtp = New SmtpClient("smtp.gmail.com", googleMailPortNumber)

'SSL must be enabled as google nicely uses encryption

smtp.EnableSsl = True

smtp.DeliveryMethod = SmtpDeliveryMethod.Network

smtp.Credentials = New System.Net.NetworkCredential(userName, passWord)

smtp.Send(msgMail)

هذا الموضوع مغلق.

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

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

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

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

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