ASP Email - clearing out a variable

T

Tom Petersen

I've got this code:
With cdoMessage
Set .Configuration = cdoConfig
.From = strEmail
.To = "(e-mail address removed)"
.Cc = strmEmail
.Subject = "Maintenance Request"
.TextBody = strBody
.Send
End With

With cdoMessage
Set .Configuration = cdoConfig
.From = "(e-mail address removed)"
.To = strEmail
.Subject = "Your Maintenance Request"
.HtmlBody = emailBody
.Send
End With

Now notice the second piece doesn't have .Cc, but they ( strmEmail from the
first piece) are still getting the emails.
How do I tell it not to send a .Cc?
I have five different possible values for strmEmail, and whichever one I
pick for the first part, shows up on the second, so I know it is passing the
value, but I don't want it to.

TIA!
Tom
 
R

Ray at

..Cc = "" will work. Either that, or you can destroy the cdoMessage object
and recreate it. Or, use the same code and use a strCc variable, and just
make sure you give it a value each time, whether that's "" or an e-mail
address.

Ray at work
 
A

Aaron Bertrand [MVP]

Destroy the object and re-create it. It's really keeping all of your
configuration options, but you're over-writing most of them before hitting
send.

Or maybe you could try setting .cc = "" or to NULL?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top