Imports System.Web.UI.HtmlControls Imports System.Web.UI Imports System.Web.UI.WebControls Dim mail As New System.Web.Mail.MailMessage() ' Dim att As System.Web.Mail.MailAttachment() mail.From = "aravind@ambersoft.net" mail.[To] = "aravind@ambersoft.net" mail.Subject = "Here goes the Subject" mail.Body = "Here comes the body..." ' mail.Attachments(att) ' att = "C:\a.txt" ' mail.Attachments.Add(att) System.Web.Mail.SmtpMail.SmtpServer = "smtp.server.of.customer" System.Web.Mail.SmtpMail.Send(mail)
att = "C:\a.txt" If Not String.IsNullOrEmpty(att) Then Using sm As New MemoryStream(Encoding.UTF8.GetBytes(att)) mail.Attachments.Add(New Attachment(sm, Path.GetFileName(att))) End Using End If
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)