Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Ron de Bruin | Excel Programming | |||
Q4 Ron de Bruin | Excel Programming | |||
ATT: Ron de Bruin (ADO help) | Excel Programming | |||
? for Ron de Bruin | Excel Programming | |||
for Ron de Bruin | Excel Programming |