MailMessage.Attachments.Add : MailMessage « System.Web.Mail « VB.Net by API






MailMessage.Attachments.Add

  


Imports System
Imports System.Web
Imports System.Web.Mail
Imports System.Data
Imports System.Drawing
Imports System.Collections
Imports System.Windows.Forms
Imports System.ComponentModel

Public Class Tester
    Public Shared Sub Main
    
        Dim mails As New MailMessage

        mails.From = "from@from.net"
        mails.To = "to@to.net"
        mails.Subject = "message"
        mails.Cc = "cc@cc.net"
        mails.Body = "this is the message"
        mails.BodyEncoding = System.Text.Encoding.UTF8
        mails.BodyFormat = MailFormat.Html
        mails.Attachments.Add("c:\\test.txt")
        SmtpMail.Send(mails)
        
    End Sub

End Class

   
    
  








Related examples in the same category

1.MailMessage.Body
2.MailMessage.From
3.MailMessage.Subject
4.MailMessage.To