ASP CDO to C#

B

Bob

How do I convert this ASP code to C#? Thank you.

<%
Dim objSend, iConf, Flds

Set objSend = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")
Set Flds = iConf.Fields

Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory")
= "c:\inetpub\mailroot\pickup"
Flds.Update

Set objSend.Configuration = iConf
objSend.To = "(e-mail address removed)"
objSend.Subject = "Testing"
objSend.From = "(e-mail address removed)"
objSend.HTMLBody = "<b>HTML</b>"
objSend.TextBody = "Text"
objSend.Send
Set objSend = Nothing
%>
 
O

Octavio Hernandez

Bob,

The classes you need is System.Web.Mail.Message and
System.Web.Mail.SmtpServer.

Regards - Octavio
 
B

Bob

Is it basically a wrapper for CDO?

Thanks.

Octavio Hernandez said:
Bob,

The classes you need is System.Web.Mail.Message and
System.Web.Mail.SmtpServer.

Regards - Octavio
 

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