27 lines
815 B
VB.net
27 lines
815 B
VB.net
Imports System.Net.Mail
|
|
Imports DevExpress.ExpressApp
|
|
|
|
Module MailSender
|
|
|
|
Sub SendSMTPMail(_ocur As Xpo.XPObjectSpace, _HRPerson As HRPerson, _ToAddress As String, _Subject As String, _Body As String)
|
|
Dim _SMTPServer As New SmtpClient
|
|
Dim _Mail As New MailMessage
|
|
|
|
Try
|
|
_SMTPServer.Credentials = New Net.NetworkCredential(_HRPerson.SMTPUserName, _HRPerson.SMTPPassword)
|
|
_SMTPServer.Port = _HRPerson.SMTPPort
|
|
_SMTPServer.Host = _HRPerson.SMTPHost
|
|
|
|
_Mail.From = New MailAddress(_HRPerson.Email)
|
|
_Mail.To.Add(_ToAddress)
|
|
_Mail.Subject = _Subject
|
|
_Mail.Body = _Body
|
|
|
|
_SMTPServer.Send(_Mail)
|
|
|
|
Catch ex As Exception
|
|
MsgBox(ex.ToString)
|
|
End Try
|
|
End Sub
|
|
End Module
|