I’m trying to update some older software which uses the now-declared-obsolete System.Web.Mail classes. Unfortunately, I don’t really know a heck of a lot about email, so I’m looking for advice.
Here is the fragment of code I’m looking at revising:
Dim myMessage As New Web.Mail.MailMessage
Dim cdoSendUsingPort As Integer = 2
Dim cdoNTLM As Integer = 2
myMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", Options.SMTPServer)
myMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25)
myMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", cdoSendUsingPort)
myMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", cdoNTLM)
From what I can tell, this should be configuring some kind of sending option. I can kind of work out what’s going on, but I don’t know how I should go about re-implementing it…
It’s looking like the place to be putting this stuff is now in the System.Net.Mail.SmtpClient.Credentials class, but the information in there doesn’t seem to bear any resemblance to what I have here.
I’m almost certain I’m making some obvious error, here, but I can’t see it. Can someone tell me what I should be doing?
I have no idea what’s actually going on here, and it looks like this function is never even used. The program does send mail, but it doesn’t send it via this function. The whole program is a mess, pulled together from a pile of external libraries.
I’ve just commented out everything that was causing an error and made a note to make the attempt to rip out this entire library when I can find the time.
I would have closed this question, but it won’t let me, and the mods didn’t close it after I flagged it.
Leaving this as a non-answer to say that the matter is resolved, even if the problem was never solved…