tôi có thể sử dụng mã này để gửi email trên máy chủ Exchange của tôiThêm nhiều dòng để cơ thể của SMTP email VB.NET
Try
Dim SmtpServer As New SmtpClient
Dim mail As New MailMessage
SmtpServer.Credentials = New Net.NetworkCredential()
SmtpServer.Port = 25
SmtpServer.Host = "email.host.com"
mail = New MailMessage
mail.From = New MailAddress("[email protected]")
mail.To.Add("[email protected]")
mail.Subject = "Equipment Request"
mail.Body = "This is for testing SMTP mail from me"
SmtpServer.Send(mail)
catch ex As Exception
MsgBox(ex.ToString)
End Try
Nhưng làm thế nào tôi có thể thêm nhiều dòng cho cơ thể?
Điều gì xảy ra khi chuẩn bị một chuỗi tin nhắn với nhiều dòng và thêm tất cả chúng vào nhau với thuộc tính cơ thể? – Steve