473,386 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Getting a CDONT parameter

My website sends automatic emails from many (25) different places. I want to
send a second email by reading the parameters of the first one. I don't want
to have to repeat and maintain the assignment of the second email
From,To,Subject fields so I am just using an include at each point in the
code where I send an email:

Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
MyCDONTSMail.BodyFormat= 0
MyCDONTSMail.MailFormat= 1
MyCDONTSMail.From= fr**************@whatever.com
MyCDONTSMail.To= to*******@whatever.com
MyCDONTSMail.Subject="some subject"
MyCDONTSMail.Body= "some text":
%>
<!--#include file="SendFollowUpEmail.asp" -->
<%
MyCDONTSMail.Send
set MyCDONTSMail=nothing
-------------------------------------------------------------------------------
The SendFollowUpEmail.asp just wants to take the From,To,Subject parameters
that are defined in the original email and add a different body:

Set MyCDONTSMail2 = CreateObject("CDONTS.NewMail")
MyCDONTSMail2.BodyFormat= 0
MyCDONTSMail2.MailFormat= 1
MyCDONTSMail2.From= MyCDONTSMail.From
MyCDONTSMail2.To= MyCDONTSMail.To
MyCDONTSMail2.Subject=MyCDONTSMail.Subject
MyCDONTSMail2.Body= "some new text"
MyCDONTSMail2.Send
set MyCDONTSMail2=nothing

It chokes on this:

MyCDONTSMail2.From= MyCDONTSMail.From

Object doesn't support this property or method: 'MyCDONTSMail.From'

Seems to me MyCDONTSMail.From is only a string, why can't I retrieve its
value? More to the point though - how can I retrieve its value?

Thanks!
Feb 1 '06 #1
11 2974
Instead of doing that, just do:

Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
MyCDONTSMail.BodyFormat= 0
MyCDONTSMail.MailFormat= 1
MyCDONTSMail.From= fr**************@whatever.com
MyCDONTSMail.Subject="some subject"
MyCDONTSMail.Body= "some text":

MyCDONTSMail.To= to*******@whatever.com
MyCDONTSMail.Send

MyCDONTSMail.To= so**************@example.com
MyCDONTSMail.Send

MyCDONTSMail.To= an***************@example.com
MyCDONTSMail.Send

MyCDONTSMail.To= so******************@example.com
MyCDONTSMail.Send

MyCDONTSMail.To= an***********@example.com
MyCDONTSMail.Send

....etc....

Are you running this in a Windows NT server? If not, you shouldn't be using
the old technology CDONTS. Please read:
http://www.aspfaq.com/show.asp?id=2026

Ray at work
"Simon Wigzell" <si**********@shaw.ca> wrote in message
news:Sy8Ef.409506$2k.270920@pd7tw1no...
My website sends automatic emails from many (25) different places. I want
to send a second email by reading the parameters of the first one. I don't
want to have to repeat and maintain the assignment of the second email
From,To,Subject fields so I am just using an include at each point in the
code where I send an email:

Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
MyCDONTSMail.BodyFormat= 0
MyCDONTSMail.MailFormat= 1
MyCDONTSMail.From= fr**************@whatever.com
MyCDONTSMail.To= to*******@whatever.com
MyCDONTSMail.Subject="some subject"
MyCDONTSMail.Body= "some text":
%>
<!--#include file="SendFollowUpEmail.asp" -->
<%
MyCDONTSMail.Send

Feb 1 '06 #2
Simon Wigzell wrote:
It chokes on this:

MyCDONTSMail2.From= MyCDONTSMail.From


Naturally. The [From] property is write-only:
http://msdn.microsoft.com/library/en...36b8054c57.asp

Use Ray's suggestion. Better yet, use CDO.

--
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.
Feb 1 '06 #3
The from address and the to address and the subject aren't known in advance,
I'm talking about a programmed website here.

I just want to know if there is a way to retrieve what has been set into a
CDONT structure, if it isn't possible then say so. I don't want to know a
different way of programming my website, its working fine. So I guess I have
to go back into all 25 pages where I do this and write specific code to send
the second email because it is not possible to retrieve what has been set
into a CDONT, ok, thanks.

(Looking up at the sky and rolling eyes)
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:%2****************@TK2MSFTNGP14.phx.gbl...
Instead of doing that, just do:

Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
MyCDONTSMail.BodyFormat= 0
MyCDONTSMail.MailFormat= 1
MyCDONTSMail.From= fr**************@whatever.com
MyCDONTSMail.Subject="some subject"
MyCDONTSMail.Body= "some text":

MyCDONTSMail.To= to*******@whatever.com
MyCDONTSMail.Send

MyCDONTSMail.To= so**************@example.com
MyCDONTSMail.Send

MyCDONTSMail.To= an***************@example.com
MyCDONTSMail.Send

MyCDONTSMail.To= so******************@example.com
MyCDONTSMail.Send

MyCDONTSMail.To= an***********@example.com
MyCDONTSMail.Send

...etc....

Are you running this in a Windows NT server? If not, you shouldn't be
using the old technology CDONTS. Please read:
http://www.aspfaq.com/show.asp?id=2026

Ray at work
"Simon Wigzell" <si**********@shaw.ca> wrote in message
news:Sy8Ef.409506$2k.270920@pd7tw1no...
My website sends automatic emails from many (25) different places. I want
to send a second email by reading the parameters of the first one. I
don't want to have to repeat and maintain the assignment of the second
email From,To,Subject fields so I am just using an include at each point
in the code where I send an email:

Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
MyCDONTSMail.BodyFormat= 0
MyCDONTSMail.MailFormat= 1
MyCDONTSMail.From= fr**************@whatever.com
MyCDONTSMail.To= to*******@whatever.com
MyCDONTSMail.Subject="some subject"
MyCDONTSMail.Body= "some text":
%>
<!--#include file="SendFollowUpEmail.asp" -->
<%
MyCDONTSMail.Send


Feb 2 '06 #4
Not the best response if you want to continue getting help here ....

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"Simon Wigzell" <si**********@shaw.ca> wrote in message
news:CcfEf.306602$tl.107165@pd7tw3no...
The from address and the to address and the subject aren't known in advance, I'm talking about a programmed website here.

I just want to know if there is a way to retrieve what has been set into a
CDONT structure, if it isn't possible then say so. I don't want to know a
different way of programming my website, its working fine. So I guess I have to go back into all 25 pages where I do this and write specific code to send the second email because it is not possible to retrieve what has been set
into a CDONT, ok, thanks.

(Looking up at the sky and rolling eyes)
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:%2****************@TK2MSFTNGP14.phx.gbl...
Instead of doing that, just do:

Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
MyCDONTSMail.BodyFormat= 0
MyCDONTSMail.MailFormat= 1
MyCDONTSMail.From= fr**************@whatever.com
MyCDONTSMail.Subject="some subject"
MyCDONTSMail.Body= "some text":

MyCDONTSMail.To= to*******@whatever.com
MyCDONTSMail.Send

MyCDONTSMail.To= so**************@example.com
MyCDONTSMail.Send

MyCDONTSMail.To= an***************@example.com
MyCDONTSMail.Send

MyCDONTSMail.To= so******************@example.com
MyCDONTSMail.Send

MyCDONTSMail.To= an***********@example.com
MyCDONTSMail.Send

...etc....

Are you running this in a Windows NT server? If not, you shouldn't be
using the old technology CDONTS. Please read:
http://www.aspfaq.com/show.asp?id=2026

Ray at work
"Simon Wigzell" <si**********@shaw.ca> wrote in message
news:Sy8Ef.409506$2k.270920@pd7tw1no...
My website sends automatic emails from many (25) different places. I want to send a second email by reading the parameters of the first one. I
don't want to have to repeat and maintain the assignment of the second
email From,To,Subject fields so I am just using an include at each point in the code where I send an email:

Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
MyCDONTSMail.BodyFormat= 0
MyCDONTSMail.MailFormat= 1
MyCDONTSMail.From= fr**************@whatever.com
MyCDONTSMail.To= to*******@whatever.com
MyCDONTSMail.Subject="some subject"
MyCDONTSMail.Body= "some text":
%>
<!--#include file="SendFollowUpEmail.asp" -->
<%
MyCDONTSMail.Send



Feb 2 '06 #5
Well - I couldn't have been more explicit describing my problem and what I
wanted to know, yet my problem remains unanswered and unadressed, meanwhile
I have been given some unrelated and useless advice, so yes, you are
probably right.
"Steven Burn" <so*******@in-time.invalid> wrote in message
news:Ov**************@TK2MSFTNGP14.phx.gbl...
Not the best response if you want to continue getting help here ....

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"Simon Wigzell" <si**********@shaw.ca> wrote in message
news:CcfEf.306602$tl.107165@pd7tw3no...
The from address and the to address and the subject aren't known in

advance,
I'm talking about a programmed website here.

I just want to know if there is a way to retrieve what has been set into
a
CDONT structure, if it isn't possible then say so. I don't want to know a
different way of programming my website, its working fine. So I guess I

have
to go back into all 25 pages where I do this and write specific code to

send
the second email because it is not possible to retrieve what has been set
into a CDONT, ok, thanks.

(Looking up at the sky and rolling eyes)
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:%2****************@TK2MSFTNGP14.phx.gbl...
> Instead of doing that, just do:
>
> Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
> MyCDONTSMail.BodyFormat= 0
> MyCDONTSMail.MailFormat= 1
> MyCDONTSMail.From= fr**************@whatever.com
> MyCDONTSMail.Subject="some subject"
> MyCDONTSMail.Body= "some text":
>
> MyCDONTSMail.To= to*******@whatever.com
> MyCDONTSMail.Send
>
> MyCDONTSMail.To= so**************@example.com
> MyCDONTSMail.Send
>
> MyCDONTSMail.To= an***************@example.com
> MyCDONTSMail.Send
>
> MyCDONTSMail.To= so******************@example.com
> MyCDONTSMail.Send
>
> MyCDONTSMail.To= an***********@example.com
> MyCDONTSMail.Send
>
> ...etc....
>
> Are you running this in a Windows NT server? If not, you shouldn't be
> using the old technology CDONTS. Please read:
> http://www.aspfaq.com/show.asp?id=2026
>
> Ray at work
>
>
> "Simon Wigzell" <si**********@shaw.ca> wrote in message
> news:Sy8Ef.409506$2k.270920@pd7tw1no...
>> My website sends automatic emails from many (25) different places. I want >> to send a second email by reading the parameters of the first one. I
>> don't want to have to repeat and maintain the assignment of the second
>> email From,To,Subject fields so I am just using an include at each point >> in the code where I send an email:
>>
>> Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
>> MyCDONTSMail.BodyFormat= 0
>> MyCDONTSMail.MailFormat= 1
>> MyCDONTSMail.From= fr**************@whatever.com
>> MyCDONTSMail.To= to*******@whatever.com
>> MyCDONTSMail.Subject="some subject"
>> MyCDONTSMail.Body= "some text":
>> %>
>> <!--#include file="SendFollowUpEmail.asp" -->
>> <%
>> MyCDONTSMail.Send
>
>



Feb 2 '06 #6
Simon Wigzell wrote:
...yet my problem remains unanswered and unadressed...


Incorrect. I directly addressed and answered it.

--
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.
Feb 2 '06 #7
On Thu, 02 Feb 2006 06:46:33 GMT, "Simon Wigzell" <si**********@shaw.ca> wrote:
in <dVhEf.534342$ki.526673@pd7tw2no>
Well - I couldn't have been more explicit describing my problem and what I
wanted to know, yet my problem remains unanswered and unadressed, meanwhile
I have been given some unrelated and useless advice, so yes, you are
probably right.


Oh I understand. This is something like "My mind is made up. Don't confuse me
with the facts!"

No problem.

---
Stefan Berglund
Feb 2 '06 #8
and here is another very good cdosys article

http://www.powerasp.com/content/new/...ail_cdosys.asp
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:%2****************@TK2MSFTNGP14.phx.gbl...
Instead of doing that, just do:

Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
MyCDONTSMail.BodyFormat= 0
MyCDONTSMail.MailFormat= 1
MyCDONTSMail.From= fr**************@whatever.com
MyCDONTSMail.Subject="some subject"
MyCDONTSMail.Body= "some text":

MyCDONTSMail.To= to*******@whatever.com
MyCDONTSMail.Send

MyCDONTSMail.To= so**************@example.com
MyCDONTSMail.Send

MyCDONTSMail.To= an***************@example.com
MyCDONTSMail.Send

MyCDONTSMail.To= so******************@example.com
MyCDONTSMail.Send

MyCDONTSMail.To= an***********@example.com
MyCDONTSMail.Send

...etc....

Are you running this in a Windows NT server? If not, you shouldn't be
using the old technology CDONTS. Please read:
http://www.aspfaq.com/show.asp?id=2026

Ray at work
"Simon Wigzell" <si**********@shaw.ca> wrote in message
news:Sy8Ef.409506$2k.270920@pd7tw1no...
My website sends automatic emails from many (25) different places. I want
to send a second email by reading the parameters of the first one. I
don't want to have to repeat and maintain the assignment of the second
email From,To,Subject fields so I am just using an include at each point
in the code where I send an email:

Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
MyCDONTSMail.BodyFormat= 0
MyCDONTSMail.MailFormat= 1
MyCDONTSMail.From= fr**************@whatever.com
MyCDONTSMail.To= to*******@whatever.com
MyCDONTSMail.Subject="some subject"
MyCDONTSMail.Body= "some text":
%>
<!--#include file="SendFollowUpEmail.asp" -->
<%
MyCDONTSMail.Send


Feb 2 '06 #9
I apologise for being cranky, just one of those days.

I have been progrmaming for 20 years and never met a language or structure
where you could assign a value to something but not get it back. My intent
here was to try to do something once, instead I ahve to do it 25 times. Oh
well, c'est la vie.

Again, I apologise for my cranky ungrateful comments to your well meaning
replies!
Feb 3 '06 #10
"Stefan Berglund" wrote in message
news:0q********************************@4ax.com...
: On Thu, 02 Feb 2006 06:46:33 GMT, "Simon Wigzell" <si**********@shaw.ca>
wrote:
: in <dVhEf.534342$ki.526673@pd7tw2no>
:
: >Well - I couldn't have been more explicit describing my problem and what
I
: >wanted to know, yet my problem remains unanswered and unadressed,
meanwhile
: >I have been given some unrelated and useless advice, so yes, you are
: >probably right.
:
: Oh I understand. This is something like "My mind is made up. Don't
confuse me
: with the facts!"
:
: No problem.

I like that response! Sorry Simon.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Feb 3 '06 #11
"Simon Wigzell" wrote in message news:Sy8Ef.409506$2k.270920@pd7tw1no...
: My website sends automatic emails from many (25) different places. I want
to
: send a second email by reading the parameters of the first one. I don't
want
: to have to repeat and maintain the assignment of the second email
: From,To,Subject fields so I am just using an include at each point in the
: code where I send an email:
:
: Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
: MyCDONTSMail.BodyFormat= 0
: MyCDONTSMail.MailFormat= 1
: MyCDONTSMail.From= fr**************@whatever.com
: MyCDONTSMail.To= to*******@whatever.com
: MyCDONTSMail.Subject="some subject"
: MyCDONTSMail.Body= "some text":
: %>
: <!--#include file="SendFollowUpEmail.asp" -->
: <%
: MyCDONTSMail.Send
: set MyCDONTSMail=nothing
: -------------------------------------------------------------------------------
: The SendFollowUpEmail.asp just wants to take the From,To,Subject
parameters
: that are defined in the original email and add a different body:
:
: Set MyCDONTSMail2 = CreateObject("CDONTS.NewMail")
: MyCDONTSMail2.BodyFormat= 0
: MyCDONTSMail2.MailFormat= 1
: MyCDONTSMail2.From= MyCDONTSMail.From
: MyCDONTSMail2.To= MyCDONTSMail.To
: MyCDONTSMail2.Subject=MyCDONTSMail.Subject
: MyCDONTSMail2.Body= "some new text"
: MyCDONTSMail2.Send
: set MyCDONTSMail2=nothing
:
: It chokes on this:
:
: MyCDONTSMail2.From= MyCDONTSMail.From
:
: Object doesn't support this property or method: 'MyCDONTSMail.From'
:
: Seems to me MyCDONTSMail.From is only a string, why can't I retrieve its
: value? More to the point though - how can I retrieve its value?

There is a lot of ways to do it. As you said the values are not known so
just pass variables to it when the values are known. It could even be
session variables.

What you do it make it a subroutine.

sub sendMail(mailFrom, mailTo, mailSubject, mailBody)
Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
MyCDONTSMail.BodyFormat = 0
MyCDONTSMail.MailFormat = 1
MyCDONTSMail.From = mailFrom
MyCDONTSMail.To = mailTo
MyCDONTSMail.Subject = mailSubject
MyCDONTSMail.Body= mailBody
end sub

With the follow up, just pass the different values to it.
sendMail "me@mydomain.com", "yo*@yourdomain.com", "My Subject", "Here is my
message!"

If your message body is formatted, pass it as a variable.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Feb 3 '06 #12

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

Similar topics

1
by: Simon Wigzell | last post by:
I'm generating HTML formatted emails in my asp program using CDONT. Depending on hoow ling the link is it will sometimes wrap and ruin the link. The is Detail email properties listing : ...
2
by: Eyal | last post by:
Hey, I would appriciate if anyone can help on this one: I have a java object/inteface having a method with a boolean parameter. As I'm trying to call this method from a javascript it fails on...
1
by: Simon Wigzell | last post by:
I send HTML formatted emails with links and images in them generated by my asp driven website. Occasionally the image will not appear and the link will not work. By looking at the email at the...
2
by: Rajiv | last post by:
hi all , i have to send the mail to all the employees of the company , e-mail address is stored in a table . i m using cdont component to send the mail , what are the basic requirement of...
2
by: Martin Raychev | last post by:
Hi all, I have the following problem: I have a private method that returns a SqlDataReader. For this to work I have not to close the DB connection in the above method. I do this only to
1
by: Simon Wigzell | last post by:
Is it possible to extract from a CDONT a value that has been added to it? e.g. can I say: MyCDONTSMail.From="some email address" MyCDONTSMail.To="some other email address"...
2
by: scotdb | last post by:
I'm trying to get the SQLERRMC info from the SQLCA into my SP so that I can use the information it provides. I'm successfully getting the SQLCODE and SQLSTATE and so added the SQLERRMC to the...
1
by: John Bailo | last post by:
This is a my solution to getting an Output parameter from a SqlDataSource. I have seen a few scant articles but none of them take it all the way to a solution. Hopefully this will help some...
1
by: bijuvellur | last post by:
why the mail goes to bulk? when we use ASP code using CDONT mail object
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.