I am wondering if there is way to save sent by vb.net email to a specific folder on hard drive as sent email containing exact information as it appears in lets say Outlook Express' "Sent Items" folder. I'd like this saved "sent" email copy to include attachment if any.
This is the code I use to email:
Imports System.Net.Mail
Module Module1
Sub Main()
Try
Dim SmtpServer As New SmtpClient()
Dim mail As New MailMessage()
SmtpServer.Credentials = New _
Net.NetworkCredential("", "")
SmtpServer.Port = 25
SmtpServer.Host = ""
mail = New MailMessage()
mail.From = New MailAddress("")
mail.To.Add("")
mail.Subject = ""
mail.Body = ""
Dim oAttch As Net.Mail.Attachment = New Net.Mail.Attachment("C:\test\testfile.pdf")
mail.Attachments.Add(oAttch)
SmtpServer.Send(mail)
CreateObject("WScript.Shell").Popup("Message Sent", 6)
Catch ex As Exception
End Try
End Sub
End Module