...

View Full Version : Question on working with variables



newkid
08-20-2004, 04:29 AM
I'm working with CDONTS (Intranet site). I'm getting Variables from form on main page just fine (txt???). Where I'm having problems is with syntax I want to substitute mail@mail.net with the variable strCc and I'm not sure on syntax. Also if there is a better way to do this open to any advice.

Thanks for any help in advance

J.C.
To learn is a good thing and today I hope to learn something new!




<%
Dim myCDONTSMail
Dim strFrom
Dim strTo
Dim strCc
Dim strSubject
Dim strMessage
Dim lngImportance

strFrom=request.form("txtFrom")
strTo=request.form("txtTo")
strCc=request.form("txtCc")
strSubject = request.form("txtSubject")
strBody=request.form("txtMessage")
lngImportance = request.form("optImportance")

Set myCDONTSMail = CreateObject("CDONTS.NewMail")
myCDONTSMail.value("Cc") = "mail@mail.net"
myCDONTSMail.Send strFrom,strTo,strSubject,strBody,lngImportance

Set myCDONTSMail = Nothing
Write "Mail has been sent."

Roy Sinclair
08-20-2004, 04:11 PM
Unless I misread your message (which is entirely possible :eek: ),



<%
Dim myCDONTSMail
Dim strFrom
Dim strTo
Dim strCc
Dim strSubject
Dim strMessage
Dim lngImportance

strFrom=request.form("txtFrom")
strTo=request.form("txtTo")
strCc=request.form("txtCc")
strSubject = request.form("txtSubject")
strBody=request.form("txtMessage")
lngImportance = request.form("optImportance")

Set myCDONTSMail = CreateObject("CDONTS.NewMail")
myCDONTSMail.value("Cc") = strCc
myCDONTSMail.Send strFrom,strTo,strSubject,strBody,lngImportance

Set myCDONTSMail = Nothing
Write "Mail has been sent."

newkid
08-20-2004, 05:15 PM
Roy, thanks but that was way to easy :thumbsup:

I was sure you needed at least a few special characters you know like
a couple of % and maybe a <> or two and then add a few " in for good measure. :o

Guess I should have just used the good old KISS method

Thanks again
J.C.
To learn is a good thing and today I have learned two things!! :confused:

Morgoth
08-21-2004, 03:30 AM
That's what I was going to post, but I didn't understand what the question was. It seemed too simple...

newkid, I am serious about this, if you wish to continue to ask questions on the forum and not get ignored by people, I suggest you learn the basics of ASP. (I am not trying to threaten you, just trying to warn you.)

I am afraid that if you don't know the basics of ASP, you will have a terrible time asking new questions which can get very complicated for you if you don't understand how to turn a string into a variable.

If you are really interested in learning ASP, and getting help with good solid questions. Questions like the above should be searched in goodle and aspin.com before posting on the forums.

newkid
08-27-2004, 03:27 AM
Morgoth, gota ya :thumbsup: and your right I should have done a search, normaly I do. and actualy if I would have been thinking I knew how to use variables, I was already using them on that page as a matter of fact.... :confused:

It was a late nite, I was brain dead, and being lazy :o

I was/it gets - frustraing at times trying to learn a dozen new things at once
(IE: HTML, VBs, ASP, SQL, CSS, and what ever else) and then add work dead-lines on top of that (and to think this all started because I said "sure I'd like to work with the web pages, but I have to admit it's a blast and you guys are great help)

thanks for the link "aspin.com" new one for me



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum