VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Send Mail Using Visual Basic

by M.Hari Hara Subramanian (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 3rd February 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Send Mail Using Visual Basic

API Declarations


Dim iConf As CDO.Configuration
Dim str As String

'add reference ' Microsoft CDO Exchange 2000 Library

Rate Send Mail Using Visual Basic



    Set iConf = CreateObject("CDO.Configuration")
    Set iFields = iConf.Fields
    iFields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2  '  SMTP
    iFields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "192.168.0.1"
    iFields.Update
    Set cdoObj.Configuration = iConf
    str = vbNullString
    cdoObj.Subject = "Hai Check mail"
    str = str & " <html> hai this is a check mail"
    str = str & " </html>"
    cdoObj.HTMLBody = str
    cdoObj.To = "" 'type your friend email id
    cdoObj.CC = ""
    cdoObj.From = "" ' type your mail id
    cdoObj.Send
    MsgBox "Mails send sucessfully"


Download this snippet    Add to My Saved Code

Send Mail Using Visual Basic Comments

No comments have been posted about Send Mail Using Visual Basic. Why not be the first to post a comment about Send Mail Using Visual Basic.

Post your comment

Subject:
Message:
0/1000 characters