469,628 Members | 1,221 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,628 developers. It's quick & easy.

CDONTS error - too much data?

I have been using the CDONTS component on Windows 2000 to send emails for a
long time now (code below).

However, over time, the report that I am sending has got rather longer and
it now gives me an "unknown exception" error. However, I know that it's
because there's now too much data (If I remove some of the text it goes
fine).

I've "compacted" the message as much as I can, but I've got up to the limit
now of how much I can compact it by...

I've tried to write it to a file and attach that, but the same size limit
appears to hold for attachments too.

What to do....?

Thanks in advance

Griff

----------------
public sub sendThatEmail(byVal sMessage, byVal asToAddressesArray)
Dim obOrderEmail
' Send the email
Set obOrderEmail = CreateObject("CDONTS.NewMail")
with obOrderEmail
.BodyFormat = 1
.MailFormat = 0
.From = sSystemAutomatedEmailSenderAddress
.Value("Reply-To") = sSystemAutomatedEmailReplyToAddress

.To = join(asToAddressesArray,";")

.Subject = "Billing Report"
.Body = sMessage
.Send
end with
Set obOrderEmail = Nothing
end sub
----------------------------


Sep 30 '05 #1
7 1914
Ditch CDONTS and switch to CDO.

http://aspfaq.com/show.asp?id=2026
http://aspfaq.com/show.asp?id=2119

--
Regards

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

Keeping it FREE!

"Griff" <Ho*****@The.Moon> wrote in message
news:es**************@TK2MSFTNGP15.phx.gbl...
I have been using the CDONTS component on Windows 2000 to send emails for a long time now (code below).

However, over time, the report that I am sending has got rather longer and
it now gives me an "unknown exception" error. However, I know that it's
because there's now too much data (If I remove some of the text it goes
fine).

I've "compacted" the message as much as I can, but I've got up to the limit now of how much I can compact it by...

I've tried to write it to a file and attach that, but the same size limit
appears to hold for attachments too.

What to do....?

Thanks in advance

Griff

----------------
public sub sendThatEmail(byVal sMessage, byVal asToAddressesArray)
Dim obOrderEmail
' Send the email
Set obOrderEmail = CreateObject("CDONTS.NewMail")
with obOrderEmail
.BodyFormat = 1
.MailFormat = 0
.From = sSystemAutomatedEmailSenderAddress
.Value("Reply-To") = sSystemAutomatedEmailReplyToAddress

.To = join(asToAddressesArray,";")

.Subject = "Billing Report"
.Body = sMessage
.Send
end with
Set obOrderEmail = Nothing
end sub
----------------------------


Sep 30 '05 #2
Looks like the way forward - thanks.

One quick question:
.Item(sch & "smtpserver") = "<enter_mail.server_here>"


What would one expect for "<enter_mail.server_here>" ? Not sure what to add
(or in what format)

Thanks!

Griff

PS One minor thing - Microsoft seem to have changed their pages around, so
some of the links to their site don't work :-(
Sep 30 '05 #3
You'll need to contact Aaron (ASPFAQ owner) about the broken links... (see
the "Feedback" link on the same page).

With regard to "<enter_mail.server_here>", this would be in the form;

"smtp.yourmailserver.com"

For example, had you been using the Microsoft server, this would be;

..Item(sch & "smtpserver") = "maila.!microsoft.com"

! added by me to prevent bot's

--
Regards

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

Keeping it FREE!

"Griff" <Ho*****@The.Moon> wrote in message
news:OS*************@tk2msftngp13.phx.gbl...
Looks like the way forward - thanks.

One quick question:
.Item(sch & "smtpserver") = "<enter_mail.server_here>"
What would one expect for "<enter_mail.server_here>" ? Not sure what to

add (or in what format)

Thanks!

Griff

PS One minor thing - Microsoft seem to have changed their pages around, so
some of the links to their site don't work :-(

Sep 30 '05 #4
As an aside, if you don't have your own dedicated mail server, use your
ISP's (if permitted) or, get yourself a copy of Argosoft;

www.argosoft.com

--
Regards

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

Keeping it FREE!

"Griff" <Ho*****@The.Moon> wrote in message
news:OS*************@tk2msftngp13.phx.gbl...
Looks like the way forward - thanks.

One quick question:
.Item(sch & "smtpserver") = "<enter_mail.server_here>"
What would one expect for "<enter_mail.server_here>" ? Not sure what to

add (or in what format)

Thanks!

Griff

PS One minor thing - Microsoft seem to have changed their pages around, so
some of the links to their site don't work :-(

Sep 30 '05 #5
Fantastic help - thanks Steven
Oct 3 '05 #6
The example given on:
http://www.w3schools.com/asp/asp_send_email.asp

Just shows the code required as:
<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="my****@mydomain.com"
myMail.To="so*****@somedomain.com"
myMail.TextBody="This is a message."
myMail.Send
set myMail=nothing
%>...without the need for setting up the configuration
details/fields.The CDONTS code (that this is replacing) did not have any
information for the SMTP server (it's all running locally) so would this be
able to pick up those details too?ThanksGriff
Oct 3 '05 #7
Yup - that seems to work fine for my needs.
Oct 3 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Guillaume Hanique | last post: by
6 posts views Thread by Jon Montana | last post: by
6 posts views Thread by kelsloris | last post: by
12 posts views Thread by Jeff | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.