Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim SmtpServer As New SmtpClient() With {
- .Port = 25,
- .Host = Email.Hostname,
- .Credentials = New NetworkCredential() With {
- .UserName = Email.UserName,
- .Password = Email.Password
- }
- }
- Dim mail As New MailMessage() With {
- .From = Email.Sender,
- .Subject = Email.Subject,
- .IsBodyHtml = True,
- .Body = Email.WrappedHtml
- }
- If Not Email.Attachments Is Nothing Then
- For Each a In Email.Attachments
- mail.Attachments.Add(a)
- Next
- End If
- mail.To.Add(New MailAddress(Email.Recipient.Email, Email.Recipient.Name))
- Call SmtpServer.Send(mail)
- SmtpServer.Dispose()
- mail.Dispose()
- SmtpServer = Nothing
- mail = Nothing
- Using SmtpServer As New SmtpClient() With {
- .Port = 25,
- .Host = Email.Hostname,
- .Credentials = New NetworkCredential() With {
- .UserName = Email.UserName,
- .Password = Email.Password
- }
- }
- Using mail As New MailMessage() With {
- .From = Email.Sender,
- .Subject = Email.Subject,
- .IsBodyHtml = True,
- .Body = Email.WrappedHtml
- }
- If Not Email.Attachments Is Nothing Then
- For Each a In Email.Attachments
- mail.Attachments.Add(a)
- Next
- End If
- mail.To.Add(New MailAddress(Email.Recipient.Email, Email.Recipient.Name))
- Call SmtpServer.Send(mail)
- End Using
- End Using
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement