Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
SamC
White Water Yakist
3467 Posts |
Posted - 2005-02-15 : 17:53:02
|
I'm reusing a CDOSYS mail "object" in a loop. Inside the loop, I've got to set Read Receipt (or not). The code looks like this:IF boolReadReceipt Then .Fields(cdoDispositionNotificationTo) = sFromAddress .Fields(cdoReturnReceiptTo) = sFromAddress Else .Fields(cdoDispositionNotificationTo) = "" .Fields(cdoReturnReceiptTo) = "" End If note that I really don't know any way to reset the read receipt other than setting the address(es) to blank.Is there a way to destroy/empty/null any prior field values instead of setting them to blank?Sam |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-02-15 : 18:32:16
|
will this do?Set Msg = CreateObject("CDO.Message")Set Conf = Msg.ConfigurationSet Fields = Conf.FieldsSet Fields = Nothing Go with the flow & have fun! Else fight the flow |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-02-16 : 14:48:07
|
Can you just dispense with the ELSE ?Kristen |
|
|
SamC
White Water Yakist
3467 Posts |
Posted - 2005-02-16 : 14:58:01
|
Kristen - I did get rid of the else, but I had to destroy the cdoMessage object at the end of the loop, and create a new cdoMessage object at the top of the loop. Got to do something with the CPU anyway...I spent several hours pursuing this one over the last few days. Here's my wrap up...There's no way to set a Field to Nothing.The "Read Receipts" email headers showed that it wasn't so much a Read Receipt as a "Disposition Notification".There was no fault in the value of boolReadReceipt. I added diagnostics to modify the subject line accordingly so the unsolicited Read Receipt notifications contained diagnostics.All this in the name of reusing a cdoMessage object. I gave up and destroy the object at the bottom of the loop, create a new object at the top.My next step in an email upgrade (if I ever do this) will be to use an object library that will asynchronously queue 50 email requests at a time and I will *not* execute it as an SQL Job. Too hard to gather runtime diagnostics. |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-02-17 : 14:36:26
|
At the risk of repeating myself: EasyMail Objects <g> |
|
|
|
|
|