السلام عليكم ورحمة الله وبركاتة
معلومات: انا لي 1 شهر وانا ابحث عن طريقة تقوم بارسائل رسائل الى البريد الاكترووووووووووني ولكن للاسف هذا الماسج يضهر لي ممن واحد يوضح لي
ليش هذا الماسج يضهر
اقتباسcould not access cdo.message
ممكن واحد يوضح لي كيف ارسل رسائل مع العلم اني قد حاولت استخدم طروق مختلفه ولم تنجح منتضر بفارغ الصبر
الطريقة الاوالى : طبعاً طلعت فاشلة
Imports System.Web.Mail
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Button1.Enabled = False
Try
Dim myMessage As New System.Web.Mail.MailMessage()
myMessage.To = txtTo.Text
myMessage.From = txtFrom.Text
myMessage.Subject = txtSubject.Text
myMessage.Body = txtBody.Text
myMessage.BodyFormat = Web.Mail.MailFormat.Text
'myMessage.Priority = Web.Mail.MailPriority.High
Dim mySMTP As System.Web.Mail.SmtpMail
mySMTP.SmtpServer.Insert(0, "127.0.0.1")
mySMTP.Send(myMessage)
MessageBox.Show("Email Sent Successfully", "AnyMail", MessageBoxButtons.OK)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Button1.Enabled = True
End Subالطريقة الثانية: طبعاً طلعت فاشلة ايضاً
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim mail As New MailMessage()
mail.To = "to yahoo id here"
mail.From = "my yahoo id here"
mail.Subject = "hi."
mail.BodyFormat = MailFormat.Text
mail.Body = "Some text goes here"
SmtpMail.SmtpServer = "smtp.mail.yahoo.com" 'your real server goes here
SmtpMail.Send(mail)
MsgBox("sent'")
End subيا ليت مساااااااااااااااااااااعدت