By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,991 Members | 1,917 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,991 IT Pros & Developers. It's quick & easy.

Understanding a code -vb 2005

P: 3
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("CDO.Message")
objMessage.Subject = "Subject"
objMessage.Sender = "EmailAddress@Domain.com"
objMessage.To = "EmailAddress@Domain.com"
objMessage.TextBody = "Main Message"
objMessage.Send

Thank you very much,

Frank
Sep 12 '07 #1
Share this Question
Share on Google+
1 Reply


kadghar
Expert 100+
P: 1,295
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("CDO.Message")
objMessage.Subject = "Subject"
objMessage.Sender = "EmailAddress@Domain.com"
objMessage.To = "EmailAddress@Domain.com"
objMessage.TextBody = "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.subject = 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.
Sep 12 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.