473,788 Members | 2,719 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CDOSYS with Variable for To: email address

Has anyone been able to use a variable for the To: line with CDOSYS? When I
put in a specific address like: myMail.To = "we*****@thispl ace.org" it works
fine. When I put in a variable like: myMail.To = areaDirector it doesn't
work. I did a reponse.write on the areaDirector and it comes out like it's
supposed to: we*****@thispla ce.org

Any ideas? Does it have something to do with the quote marks?
Dec 29 '05 #1
4 1803
I Use variables with CDOSYS all the time. Never had an issue ever.
It's essentially the same thing in the end. You got something else going on.
"Jess" <Je**@discussio ns.microsoft.co m> wrote in message
news:2E******** *************** ***********@mic rosoft.com...
Has anyone been able to use a variable for the To: line with CDOSYS? When
I
put in a specific address like: myMail.To = "we*****@thispl ace.org" it
works
fine. When I put in a variable like: myMail.To = areaDirector it doesn't
work. I did a reponse.write on the areaDirector and it comes out like
it's
supposed to: we*****@thispla ce.org

Any ideas? Does it have something to do with the quote marks?

Dec 29 '05 #2
If you want tomsehting to pay around with this code uses variables for
everything as well and it all works fine.
http://www.powerasp.com/content/new/...ing_cdosys.asp
"Kyle Peterson" <ky*****@hotmai l.com> wrote in message
news:e2******** ******@tk2msftn gp13.phx.gbl...
I Use variables with CDOSYS all the time. Never had an issue ever.
It's essentially the same thing in the end. You got something else going
on.
"Jess" <Je**@discussio ns.microsoft.co m> wrote in message
news:2E******** *************** ***********@mic rosoft.com...
Has anyone been able to use a variable for the To: line with CDOSYS?
When I
put in a specific address like: myMail.To = "we*****@thispl ace.org" it
works
fine. When I put in a variable like: myMail.To = areaDirector it doesn't
work. I did a reponse.write on the areaDirector and it comes out like
it's
supposed to: we*****@thispla ce.org

Any ideas? Does it have something to do with the quote marks?


Dec 29 '05 #3
tomsehting lol
"Kyle Peterson" <ky*****@hotmai l.com> wrote in message
news:en******** ******@TK2MSFTN GP11.phx.gbl...
If you want tomsehting to pay around with this code uses variables for
everything as well and it all works fine.
http://www.powerasp.com/content/new/...ing_cdosys.asp
"Kyle Peterson" <ky*****@hotmai l.com> wrote in message
news:e2******** ******@tk2msftn gp13.phx.gbl...
I Use variables with CDOSYS all the time. Never had an issue ever.
It's essentially the same thing in the end. You got something else going
on.
"Jess" <Je**@discussio ns.microsoft.co m> wrote in message
news:2E******** *************** ***********@mic rosoft.com...
Has anyone been able to use a variable for the To: line with CDOSYS?
When I
put in a specific address like: myMail.To = "we*****@thispl ace.org" it
works
fine. When I put in a variable like: myMail.To = areaDirector it
doesn't
work. I did a reponse.write on the areaDirector and it comes out like
it's
supposed to: we*****@thispla ce.org

Any ideas? Does it have something to do with the quote marks?



Dec 29 '05 #4
Jess wrote:
Has anyone been able to use a variable for the To: line with CDOSYS?
When I put in a specific address like: myMail.To =
"we*****@thispl ace.org" it works fine. When I put in a variable
like: myMail.To = areaDirector it doesn't work. I did a
reponse.write on the areaDirector and it comes out like it's supposed
to: we*****@thispla ce.org

Any ideas? Does it have something to do with the quote marks?


It has nothing to do with quote marks. I suspect you are assigning an object
reference to your variable rather than a string value. For example:

areaDirector = oRS("director")

In the above example, VBScript will assign the default property only as long
as the recordset object is open, while this variation persists beyond the
lifespan of the recordset:

areaDirector = oRS.Fields("dir ector").Value


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Dec 30 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4125
by: Andy | last post by:
Hi Aarron Your code below helped me move from CDONTS email to CDOSYS email. My one question is how do I set this CDOSYS email as HTML formatted email. As it is now it just sends straight text. http://www.aspfaq.com/2339 Can you help? Andy
3
5874
by: Serge Myrand | last post by:
Hi everybody, The following code for sending email (found on msn I think) works find when used in a .VBS file. I double click the file and the mail is send. When I use the same code in my .ASP application I get the following message: "The pickup directory path is required and was not specified" Where to specify that directory?
21
4015
by: tp | last post by:
HI..... I have made simpale web site inside that i am generating email page which send form as email. i have setup small business server with Exchange server 2003 and i have hosted my website with this server. i can not generate email using following code while same code working with my developement XP machine installed SMTP service.
9
2703
by: tshad | last post by:
This is a problem that we saw before on our asp site, but don't know how to fix it. We are seeing it on our .net site also. We have our email sending from our Windows 2003 server with exchange fine, unless we send to an alias. It never gets there. I can send directly and it works fine and the CDOSYS works fine to a non-alias account.
3
1294
by: Jess | last post by:
Hi, I'm sending an email with CDOSYS. In myMail.To = emailSubmitter <-When I use a variable here it doesn't send. When I use a specific address like anybody@anywhere.com it works. Here's how I set up emailSubmitter emailSubmitter = rs("emailAddr") Any ideas?
0
3461
by: Larry D | last post by:
I have a client with a site that users can register at, we collect their emails, if they have one, in an Access db. I have a page that uses CDOSYS to send messages to those emails but I am getting "error '8004020f" when I do this. About 75% of the members have emails so some email fields in the db are empty. One issue with my webhost is that I cannot send by CDOSYS more than 99 emails at a time, so I select all emails where the ID is less...
0
1406
by: david220 | last post by:
hi once members sign up to my site they get sent an email which contains there username/password which they enter on a sign up form. Once they've signed up the email is automatically sent using the code below. The site uses classic asp and vbscript, with the email bit in cdonts. I recently changed hosts and they use cdosys. I have used cdosys email before but are'nt sure how to get it to connect to the asp bits they enter on the sign...
9
3029
by: paulmitchell507 | last post by:
I have a file called email2.asp which I am using to mail data obtained from a SQL query. I would like to pass the holiday_ID value in the querystring attached to the end of the URL. It all works except that I can't get the value of holiday_ID included as a querystring. As a test I can insert a value after the ?id= and this is passed as a querystring. I am sure it's just the syntax that I am having problem with
3
2260
by: viki1967 | last post by:
Hi all. I have problem whit this email address: john.d'almonte@mydomain.com If email address contain apostrophe the send email ( I send with CDOSYS component) responde with failure. I have try whit replace, but not working.
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10373
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8995
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4074
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2897
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.