31-07-19, 01:23 PM
PHP كود :
Function SendEmail(ByVal Msg As String) As Boolean
Dim emailMessage As New System.Net.Mail.MailMessage()
Try
emailMessage.From = New System.Net.Mail.MailAddress("ايميل المرسل اليه")
emailMessage.To.Add("ايميل المرسل اليه")
emailMessage.Subject = " عنوان الايميل"
emailMessage.IsBodyHtml = True
emailMessage.Body = Msg
Dim SMTP As New System.Net.Mail.SmtpClient("smtp.gmail.com")
SMTP.Port = 587
SMTP.Host = "smtp.gmail.com"
SMTP.EnableSsl = True
SMTP.Credentials = New System.Net.NetworkCredential("ايميل المرسل", "كلمة مرور ايميل المرسل")
SMTP.Send(emailMessage)
Return True
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error")
Return False
End Try
End Function
