Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default RON DE BRUIN: Help with CDO Please

Hi Ron -
First let me say THANK YOU for being such a great resource! You and
your website have helped me out a great deal.

I started using the CDO emails to send status and reports at certain
intervals every morning while my computer runs a battery of daily
reports. Below is an example of one of these emails, the only
difference with each mailer is the body text, attachments and the
recipient list.

Sub SndInv()
Set oEmail = CreateObject("CDO.Message")
oEmail.From = myserver
oEmail.To = myrecipients
oEmail.Subject = "AUTOMATED MAILER: "
oEmail.Textbody = "* * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * *" & vbNewLine _
& vbNewLine _
& "Attached is the Report for " & Format(Date, "m/d/
yy") & vbNewLine _
& "* * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * *"
oEmail.AddAttachment "path/file name"
oEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/
configuration/sendusing") = 2
oEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/
configuration/smtpserver") = "my mail server"
oEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/
configuration/authenticate") = 1
oEmail.Configuration.Fields.Update
oEmail.Send
Set oEmail = Nothing
End Sub

This code works ALMOST flawlessly. However from time to time I
"cannot connect to transport server". There is no pattern to this
whatsoever. Today, 4 out of 6 emails have not been sent (the other
two have not run yet as of this posting), prior to today there have
been no issues for over a month.

Given how sporodical the errors are, i don't think it is a firewall
issue...but not sure....

Any insight? Do you have any ideas as to how I could write an error
handler (never written one) that could save the emails (to send
manually?) and let the reports keep running instead of waiting for a
debug?


Any help would be much appreciated!!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default RON DE BRUIN: Help with CDO Please

Hi Newbike

Try to add this

..Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Newbike" wrote in message oups.com...
Hi Ron -
First let me say THANK YOU for being such a great resource! You and
your website have helped me out a great deal.

I started using the CDO emails to send status and reports at certain
intervals every morning while my computer runs a battery of daily
reports. Below is an example of one of these emails, the only
difference with each mailer is the body text, attachments and the
recipient list.

Sub SndInv()
Set oEmail = CreateObject("CDO.Message")
oEmail.From = myserver
oEmail.To = myrecipients
oEmail.Subject = "AUTOMATED MAILER: "
oEmail.Textbody = "* * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * *" & vbNewLine _
& vbNewLine _
& "Attached is the Report for " & Format(Date, "m/d/
yy") & vbNewLine _
& "* * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * *"
oEmail.AddAttachment "path/file name"
oEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/
configuration/sendusing") = 2
oEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/
configuration/smtpserver") = "my mail server"
oEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/
configuration/authenticate") = 1
oEmail.Configuration.Fields.Update
oEmail.Send
Set oEmail = Nothing
End Sub

This code works ALMOST flawlessly. However from time to time I
"cannot connect to transport server". There is no pattern to this
whatsoever. Today, 4 out of 6 emails have not been sent (the other
two have not run yet as of this posting), prior to today there have
been no issues for over a month.

Given how sporodical the errors are, i don't think it is a firewall
issue...but not sure....

Any insight? Do you have any ideas as to how I could write an error
handler (never written one) that could save the emails (to send
manually?) and let the reports keep running instead of waiting for a
debug?


Any help would be much appreciated!!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ron de Bruin steve Excel Programming 21 August 19th 06 06:16 PM
Q4 Ron de Bruin Newbie Excel Programming 4 August 7th 06 09:26 AM
ATT: Ron de Bruin (ADO help) FrigidDigit[_2_] Excel Programming 7 October 19th 05 03:14 PM
? for Ron de Bruin Chet[_2_] Excel Programming 4 September 23rd 04 03:55 PM
for Ron de Bruin Valeria[_2_] Excel Programming 1 January 22nd 04 04:42 PM


All times are GMT +1. The time now is 12:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"