I know that with the following code in VB.NET you can send a mail
What I want to do:
retrieve data from a database (with a SELECT) and mail them. How? I cant attach them because there arent in a file, I cant put it to message body because there are not a string.
Please tell me the solution. (I want to mail a DataTable)
P.S. I dont want to make them in a file
Code:
Dim myMailServer As SmtpMail
Dim myMessage As New MailMessage()
myMessage.BodyFormat = MailFormat.Text
myMessage.Priority = MailPriority.Normal
myMessage.From = "xxx@apn-automation.com"
myMessage.To = "yyy@yahoo.fr" To Address
myMessage.Subject = msgSubject
myMessage.Body = body
myMessage.Attachments.Add(...)
myMailServer.SmtpServer = "mySMTPserver"
myMailServer.Send(myMessage)
myMessage = Nothing
What I want to do:
retrieve data from a database (with a SELECT) and mail them. How? I cant attach them because there arent in a file, I cant put it to message body because there are not a string.
Please tell me the solution. (I want to mail a DataTable)
P.S. I dont want to make them in a file