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= fromemailaddress@whatever.com
MyCDONTSMail.To= toaddress@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!

Re: Getting a CDONT parameter by Ray

Ray
Wed Feb 01 14:19:59 CST 2006

Instead of doing that, just do:

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

MyCDONTSMail.To= toaddress@whatever.com
MyCDONTSMail.Send

MyCDONTSMail.To= someotheraddress@example.com
MyCDONTSMail.Send

MyCDONTSMail.To= andanotheraddress@example.com
MyCDONTSMail.Send

MyCDONTSMail.To= somedifferentaddress@example.com
MyCDONTSMail.Send

MyCDONTSMail.To= andyetanother@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" <simonwigzell@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= fromemailaddress@whatever.com
> MyCDONTSMail.To= toaddress@whatever.com
> MyCDONTSMail.Subject="some subject"
> MyCDONTSMail.Body= "some text":
> %>
> <!--#include file="SendFollowUpEmail.asp" -->
> <%
> MyCDONTSMail.Send



Re: Getting a CDONT parameter by Dave

Dave
Wed Feb 01 15:18:01 CST 2006

Simon Wigzell wrote:
> It chokes on this:
>
> MyCDONTSMail2.From= MyCDONTSMail.From

Naturally. The [From] property is write-only:
http://msdn.microsoft.com/library/en-us/cdo/html/36d01b22-2cb6-45f9-95d2-e536b8054c57.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.



Re: Getting a CDONT parameter by Simon

Simon
Wed Feb 01 21:42:26 CST 2006

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:%23oUOhz2JGHA.2012@TK2MSFTNGP14.phx.gbl...
> Instead of doing that, just do:
>
> Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
> MyCDONTSMail.BodyFormat= 0
> MyCDONTSMail.MailFormat= 1
> MyCDONTSMail.From= fromemailaddress@whatever.com
> MyCDONTSMail.Subject="some subject"
> MyCDONTSMail.Body= "some text":
>
> MyCDONTSMail.To= toaddress@whatever.com
> MyCDONTSMail.Send
>
> MyCDONTSMail.To= someotheraddress@example.com
> MyCDONTSMail.Send
>
> MyCDONTSMail.To= andanotheraddress@example.com
> MyCDONTSMail.Send
>
> MyCDONTSMail.To= somedifferentaddress@example.com
> MyCDONTSMail.Send
>
> MyCDONTSMail.To= andyetanother@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" <simonwigzell@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= fromemailaddress@whatever.com
>> MyCDONTSMail.To= toaddress@whatever.com
>> MyCDONTSMail.Subject="some subject"
>> MyCDONTSMail.Body= "some text":
>> %>
>> <!--#include file="SendFollowUpEmail.asp" -->
>> <%
>> MyCDONTSMail.Send
>
>



Re: Getting a CDONT parameter by Steven

Steven
Wed Feb 01 22:08:26 CST 2006

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" <simonwigzell@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:%23oUOhz2JGHA.2012@TK2MSFTNGP14.phx.gbl...
> > Instead of doing that, just do:
> >
> > Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
> > MyCDONTSMail.BodyFormat= 0
> > MyCDONTSMail.MailFormat= 1
> > MyCDONTSMail.From= fromemailaddress@whatever.com
> > MyCDONTSMail.Subject="some subject"
> > MyCDONTSMail.Body= "some text":
> >
> > MyCDONTSMail.To= toaddress@whatever.com
> > MyCDONTSMail.Send
> >
> > MyCDONTSMail.To= someotheraddress@example.com
> > MyCDONTSMail.Send
> >
> > MyCDONTSMail.To= andanotheraddress@example.com
> > MyCDONTSMail.Send
> >
> > MyCDONTSMail.To= somedifferentaddress@example.com
> > MyCDONTSMail.Send
> >
> > MyCDONTSMail.To= andyetanother@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" <simonwigzell@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= fromemailaddress@whatever.com
> >> MyCDONTSMail.To= toaddress@whatever.com
> >> MyCDONTSMail.Subject="some subject"
> >> MyCDONTSMail.Body= "some text":
> >> %>
> >> <!--#include file="SendFollowUpEmail.asp" -->
> >> <%
> >> MyCDONTSMail.Send
> >
> >
>
>



Re: Getting a CDONT parameter by Simon

Simon
Thu Feb 02 00:46:33 CST 2006

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" <somewhere@in-time.invalid> wrote in message
news:Ov$JC56JGHA.2696@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" <simonwigzell@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:%23oUOhz2JGHA.2012@TK2MSFTNGP14.phx.gbl...
>> > Instead of doing that, just do:
>> >
>> > Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
>> > MyCDONTSMail.BodyFormat= 0
>> > MyCDONTSMail.MailFormat= 1
>> > MyCDONTSMail.From= fromemailaddress@whatever.com
>> > MyCDONTSMail.Subject="some subject"
>> > MyCDONTSMail.Body= "some text":
>> >
>> > MyCDONTSMail.To= toaddress@whatever.com
>> > MyCDONTSMail.Send
>> >
>> > MyCDONTSMail.To= someotheraddress@example.com
>> > MyCDONTSMail.Send
>> >
>> > MyCDONTSMail.To= andanotheraddress@example.com
>> > MyCDONTSMail.Send
>> >
>> > MyCDONTSMail.To= somedifferentaddress@example.com
>> > MyCDONTSMail.Send
>> >
>> > MyCDONTSMail.To= andyetanother@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" <simonwigzell@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= fromemailaddress@whatever.com
>> >> MyCDONTSMail.To= toaddress@whatever.com
>> >> MyCDONTSMail.Subject="some subject"
>> >> MyCDONTSMail.Body= "some text":
>> >> %>
>> >> <!--#include file="SendFollowUpEmail.asp" -->
>> >> <%
>> >> MyCDONTSMail.Send
>> >
>> >
>>
>>
>
>



Re: Getting a CDONT parameter by Dave

Dave
Thu Feb 02 07:49:36 CST 2006

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.



Re: Getting a CDONT parameter by Stefan

Stefan
Thu Feb 02 12:12:14 CST 2006

On Thu, 02 Feb 2006 06:46:33 GMT, "Simon Wigzell" <simonwigzell@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

Re: Getting a CDONT parameter by Kyle

Kyle
Thu Feb 02 12:15:34 CST 2006

and here is another very good cdosys article

http://www.powerasp.com/content/new/sending_email_cdosys.asp


"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:%23oUOhz2JGHA.2012@TK2MSFTNGP14.phx.gbl...
> Instead of doing that, just do:
>
> Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
> MyCDONTSMail.BodyFormat= 0
> MyCDONTSMail.MailFormat= 1
> MyCDONTSMail.From= fromemailaddress@whatever.com
> MyCDONTSMail.Subject="some subject"
> MyCDONTSMail.Body= "some text":
>
> MyCDONTSMail.To= toaddress@whatever.com
> MyCDONTSMail.Send
>
> MyCDONTSMail.To= someotheraddress@example.com
> MyCDONTSMail.Send
>
> MyCDONTSMail.To= andanotheraddress@example.com
> MyCDONTSMail.Send
>
> MyCDONTSMail.To= somedifferentaddress@example.com
> MyCDONTSMail.Send
>
> MyCDONTSMail.To= andyetanother@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" <simonwigzell@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= fromemailaddress@whatever.com
>> MyCDONTSMail.To= toaddress@whatever.com
>> MyCDONTSMail.Subject="some subject"
>> MyCDONTSMail.Body= "some text":
>> %>
>> <!--#include file="SendFollowUpEmail.asp" -->
>> <%
>> MyCDONTSMail.Send
>
>



Re: Getting a CDONT parameter by Simon

Simon
Thu Feb 02 18:25:40 CST 2006

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!



Re: Getting a CDONT parameter by Roland

Roland
Fri Feb 03 07:15:31 CST 2006

"Stefan Berglund" wrote in message
news:0qi4u19nmhbalgcvtlhauj38uojgsqmb2o@4ax.com...
: On Thu, 02 Feb 2006 06:46:33 GMT, "Simon Wigzell" <simonwigzell@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



Re: Getting a CDONT parameter by Roland

Roland
Fri Feb 03 07:23:35 CST 2006

"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= fromemailaddress@whatever.com
: MyCDONTSMail.To= toaddress@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", "you@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