currently i use this code to send an email through vb applications. I am now having to use c# and i was wondering if there was something similar i could write in c# which would do the same?
Set oEmail = CreateObject("CDO.Message")
oEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
oEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "127.0.0.1"
oEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") =25
oEmail.Configuration.Fields.Update
oEmail.From = "test@test.co.uk"
oEmail.To = "test@test.com"
oEmail.Subject = "Subject!!"
oEmail.Textbody = "The body"
oEmail.Send
Set oEmail = nothing
You could use the SmtpClient class to send email in .NET: