Hi Abel,
I'm not an expert in this area, but I came across an article which may help
you.
313776 HOW TO: Send Mail with Configuration by Using Collaboration Data
Objects
http://kb/article.asp?id=Q313776
I hope this helps.
Thank you, Mike
Microsoft, ASP.NET Support Professional
Microsoft highly recommends to all of our customers that they visit the
http://www.microsoft.com/protect site and perform the three straightforward
steps listed to improve your computer’s security.
This posting is provided "AS IS", with no warranties, and confers no rights.
--------------------
From: Abel Martinez <ab***********@sourcemed.net>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Subject: CDO.Configuration
Date: Fri, 24 Oct 2003 09:12:21 -0500
Organization: Source Medical
Message-ID: <8e********************************@4ax.com>
X-Newsreader: Forte Free Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Complaints-To: ab***@supernews.com
Lines: 31
Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!news-out.cwix.com!newsfeed.cwix.co
m!prodigy.com!in.100proofnews.com!in.100proofnews. com!pd7cy1no!shaw.ca!sn-xi
t-03!sn-xit-04!sn-xit-01!sn-post-01!supernews.com!news.supernews.com!not-for
-mail Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:186324
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
Hello. I'm looking for an example of how to do this in C#.
Particulary the CDO.Configuration stuff. I'm currently using
System.Web.Mail.MailMessage and System.Web.Mail.SmtpMail to send
messaged, but I need to set this "sendusing" attribute and don't know
the syntax for doing it in C#. Thanks!!
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = Server.CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(sch & "sendusing") = 2 ' cdoSendUsingPort
.Item(sch & "smtpserver") = "<enter_mail.server_here>"
.update
End With
Set cdoMessage = Server.CreateObject("CDO.Message")
With cdoMessage
Set .Configuration = cdoConfig
.From = "fr**@me.com"
.To = "to@me.com"
.Subject = "Sample CDO Message"
.TextBody = "This is a test for CDO.message"
.Send
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing