CDO.Configuration

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Abel Martinez

    #1

    CDO.Configuration

    Hello. I'm looking for an example of how to do this in C#.
    Particulary the CDO.Configurati on 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.microso ft.com/cdo/configuration/"

    Set cdoConfig = Server.CreateOb ject("CDO.Confi guration")

    With cdoConfig.Field s
    .Item(sch & "sendusing" ) = 2 ' cdoSendUsingPor t
    .Item(sch & "smtpserver ") = "<enter_mail.se rver_here>"
    .update
    End With

    Set cdoMessage = Server.CreateOb ject("CDO.Messa ge")

    With cdoMessage
    Set .Configuration = cdoConfig
    .From = "from@me.co m"
    .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

  • Mike Moore [MSFT]

    #2
    RE: CDO.Configurati on

    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


    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.


    --------------------[color=blue]
    > From: Abel Martinez <abel.martinez@ sourcemed.net>
    > Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
    > Subject: CDO.Configurati on
    > Date: Fri, 24 Oct 2003 09:12:21 -0500
    > Organization: Source Medical
    > Message-ID: <8ecipv42k081om ha8pbdekfs8roei 30obp@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: abuse@supernews .com
    > Lines: 31
    > Path:[/color]
    cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!new s-out.cwix.com!ne wsfeed.cwix.co
    m!prodigy.com!i n.100proofnews. com!in.100proof news.com!pd7cy1 no!shaw.ca!sn-xi
    t-03!sn-xit-04!sn-xit-01!sn-post-01!supernews.co m!news.supernew s.com!not-for
    -mail[color=blue]
    > Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:1863 24
    > X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
    >
    > Hello. I'm looking for an example of how to do this in C#.
    > Particulary the CDO.Configurati on 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.microso ft.com/cdo/configuration/"
    >
    > Set cdoConfig = Server.CreateOb ject("CDO.Confi guration")
    >
    > With cdoConfig.Field s
    > .Item(sch & "sendusing" ) = 2 ' cdoSendUsingPor t
    > .Item(sch & "smtpserver ") = "<enter_mail.se rver_here>"
    > .update
    > End With
    >
    > Set cdoMessage = Server.CreateOb ject("CDO.Messa ge")
    >
    > With cdoMessage
    > Set .Configuration = cdoConfig
    > .From = "from@me.co m"
    > .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
    >
    >[/color]

    Comment

    Working...