VB.NET Send email using CDOSYS

Using CDOSYS is another easy way to send email from VB.NET . For sending email using CDOSYS , you have to send email from Windows 2000/XP and also you have to be enabled SMTP Service in IIS .


  1. Windows XP/ Windows2000
  2. Internet Information Services (IIS)
  3. SMTP Services in IIS should be enable.

Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, 
	ByVal e As System.EventArgs) Handles Button1.Click
        Dim CDOSYS As Object
        Const cdoSendUsingPickup = 1
        Const strPickup = "c:\inetpub\mailroot\pickup"
        CDOSYS = CreateObject("CDO.Message")

        CDOSYS.Configuration.Fields.item _
	("") _
	= cdoSendUsingPickup

        CDOSYS.Configuration.Fields.item _
	("" & _
	/smtpserverpickupdirectory")  _
	= strPickup

        CDOSYS.To = "TO ADDRESS"
        CDOSYS.From = "FROM ADDRESS"
        CDOSYS.Subject = "CDO Test"
        CDOSYS.TextBody = "Send Email from using CDOSYS"
        CDOSYS = Nothing
        MsgBox("mail send")
    End Sub
End Class

You have to provide the informations like To Address , From Address and it is very important to enable your SMTP services in IIS . (C) 2021    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.
SiteMap  | Terms  | About