Understanding a code -vb 2005

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • frank1730
    New Member
    • Sep 2007
    • 3

    Understanding a code -vb 2005

    I'm using VB2005 and am trying to make the text of 2 textboxes send to my email when the user clicks on a button below. I found this code online but I am not sure about the objMessage part and the entire first line.

    Set objMessage = CreateObject("C DO.Message")
    objMessage.Subj ect = "Subject"
    objMessage.Send er = "EmailAddress@D omain.com"
    objMessage.To = "EmailAddress@D omain.com"
    objMessage.Text Body = "Main Message"
    objMessage.Send

    Thank you very much,

    Frank
  • kadghar
    Recognized Expert Top Contributor
    • Apr 2007
    • 1302

    #2
    Originally posted by frank1730
    I'm using VB2005 and am trying to make the text of 2 textboxes send to my email when the user clicks on a button below. I found this code online but I am not sure about the objMessage part and the entire first line.

    Set objMessage = CreateObject("C DO.Message")
    objMessage.Subj ect = "Subject"
    objMessage.Send er = "EmailAddress@D omain.com"
    objMessage.To = "EmailAddress@D omain.com"
    objMessage.Text Body = "Main Message"
    objMessage.Send

    Thank you very much,

    Frank
    what you're doing is creating an object with a CDO message in it, then you're changing some properties, like subject or sender, and then you're performing an action: sending it

    you can use a text box to asign this properties, lets say you have the Subject in textbox1:

    objmessage.subj ect = textbox1.text

    im not sure if this code will work fine if you dont have asp.net but there is a free version, so dont worry about it.

    Comment

    Working...