Using CDO to connect to remote SMTP servers

D

desais

I am using the cdo.dll to send out emails in C#. But instead of
connecting to my local smtp to forward the email I am changing the smtp
server to the recipients server for each email. This works just fine in
all of the tests that I have done. The issue I am having though is that
although the thread that handles mailing a group of emails with cdo is
closed and everything in the thread is disposed, the connection stays
established. When I check netstat the connection to the remote mail
servers is only closed once my main application is closed. This
behavior would be fine if cdo was just connecting to a single local
smtp server, but doesn't work for my situation. Does anyone know a way
to get cdo to close the connection once mail has been sent? I'm not
really sure if the connection is actually even open, just that it stays
listed in netstat as open until the main app is closed. I am also
trying to avoid using cdo alternative packages, but that would be a
worst case scenario. I'm also not sure if this is a .Net/C# issue
where the cdo object is not being correctly disposed after its thread
is aborted or a cdo issue.
 
N

Nick Hounsome

I am using the cdo.dll to send out emails in C#. But instead of
connecting to my local smtp to forward the email I am changing the smtp
server to the recipients server for each email.

The whole point of the email system is that it is fire and forget - you can
send an email even if the remote system is down - the email system just
tries again later. You have reduced it to a chat system by attempting to
send your emails directly.
 
D

desais

The reason I am doing this is to detect hard bounces on a subset of our
emails. These emails would be leaving our circulation management
software with an xml header. The header from the email is stripped and
then the data is dumped into a db to track along with other vars, which
are included in the header. Also due to limitations in our CMS the from
address is also being changed based on header info. The email is also
flagged with a tracking id. Normally this subset of email would hit our
exchange server, which would then do the same direct connections to the
domain email servers anyway. I don't know of any free software that
would provide the flexibility we need. I also don't know of a way to
get exchange to immediately report hard bounces on only a subset of
emails.
 

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

Top