Code equivalent for this.......Help

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

    #1

    Code equivalent for this.......Help

    HI,

    Below is the code in vb to send mail using CDO object. I
    want to do the same in VB.Net , i need to know how to sent
    the authentication in vb.net "
    ..Item(cdoSMTPA uthenticate) = cdoBasic"




    VB
    -------------------------------------------------------

    Dim iMsg as New CDO.Message
    Dim iConf as New CDO.Configurati on

    Dim Flds as ADODB.Fields
    Set Flds = iConf.Fields

    With Flds
    .Item(cdoSendUs ingMethod) = cdoSendUsingPor t
    .Item(cdoSMTPSe rverName)
    = "somehost@micro soft.com"
    .Item(cdoSMTPCo nnectionTimeout ) = 10 ' quick timeout
    .Item(cdoSMTPAu thenticate) = cdoBasic
    .Item(cdoSendUs erName) = "username"
    .Item(cdoSendPa ssword) = "password"
    .Item(cdoURLPro xyServer) = "server:80"
    .Item(cdoURLPro xyBypass) = "<local>"
    .Item(cdoURLGet LatestVersion) = True
    .Update
    End With

    With iMsg
    Set .Configuration = iConf
    .To = """User A"" <userA@microsof t.com>"
    .From = """User B"" <userB@microsof t.com>"
    .Subject = "Hows it going? I've attached my web
    page"
    .CreateMHTMLBod y "http://mypage"
    .AddAttachment "C:\files\myboo k.doc"
    .Send
    End With
    -------------------------------------------------------

    thanks
  • Sreejumon[MVP]

    #2
    Re: Code equivalent for this.......Help

    Hi Jyakumar,

    Please refer the System.Web.Mail namespace. This is the CDO implementation
    in .net world. Please refer the following link.


    --
    Let me know if you need further help

    Regards
    Sreejumon[MVP]


    "jayakumar" <jayakumara@hot mail.com> wrote in message
    news:086001c366 da$c2d2bb80$a40 1280a@phx.gbl.. .[color=blue]
    > HI,
    >
    > Below is the code in vb to send mail using CDO object. I
    > want to do the same in VB.Net , i need to know how to sent
    > the authentication in vb.net "
    > .Item(cdoSMTPAu thenticate) = cdoBasic"
    >
    >
    >
    >
    > VB
    > -------------------------------------------------------
    >
    > Dim iMsg as New CDO.Message
    > Dim iConf as New CDO.Configurati on
    >
    > Dim Flds as ADODB.Fields
    > Set Flds = iConf.Fields
    >
    > With Flds
    > .Item(cdoSendUs ingMethod) = cdoSendUsingPor t
    > .Item(cdoSMTPSe rverName)
    > = "somehost@micro soft.com"
    > .Item(cdoSMTPCo nnectionTimeout ) = 10 ' quick timeout
    > .Item(cdoSMTPAu thenticate) = cdoBasic
    > .Item(cdoSendUs erName) = "username"
    > .Item(cdoSendPa ssword) = "password"
    > .Item(cdoURLPro xyServer) = "server:80"
    > .Item(cdoURLPro xyBypass) = "<local>"
    > .Item(cdoURLGet LatestVersion) = True
    > .Update
    > End With
    >
    > With iMsg
    > Set .Configuration = iConf
    > .To = """User A"" <userA@microsof t.com>"
    > .From = """User B"" <userB@microsof t.com>"
    > .Subject = "Hows it going? I've attached my web
    > page"
    > .CreateMHTMLBod y "http://mypage"
    > .AddAttachment "C:\files\myboo k.doc"
    > .Send
    > End With
    > -------------------------------------------------------
    >
    > thanks[/color]


    Comment

    • Kevin Spencer

      #3
      Re: Code equivalent for this.......Help

      Whatever account ASP.Net is running under, that is the account that is
      sending the mail. Just add that account to the SMTP Server's authenticated
      operators.

      --
      HTH,

      Kevin Spencer
      Microsoft MVP
      ..Net Developer
      All hotels in Benidorm. The best selection of Benidorm hotels with reviews and maps. Book in advance and save.

      Neither a follower nor a lender be.

      "jayakumar" <jayakumara@hot mail.com> wrote in message
      news:087201c366 e0$0354c360$a60 1280a@phx.gbl.. .[color=blue]
      > HI,
      >
      > Thanks, but my smtp server is authenticated. How do u
      > specify the Username and password for the server.
      >
      >[color=green]
      > >-----Original Message-----
      > >Hi Jyakumar,
      > >
      > >Please refer the System.Web.Mail namespace. This is the[/color]
      > CDO implementation[color=green]
      > >in .net world. Please refer the following link.
      > >http://www.codeproject.com/useritems/epsendmail.asp
      > >
      > >--
      > >Let me know if you need further help
      > >
      > >Regards
      > >Sreejumon[MVP]
      > >www.mstechzone.com
      > >
      > >"jayakumar" <jayakumara@hot mail.com> wrote in message
      > >news:086001c36 6da$c2d2bb80$a4 01280a@phx.gbl. ..[color=darkred]
      > >> HI,
      > >>
      > >> Below is the code in vb to send mail using CDO[/color][/color]
      > object. I[color=green][color=darkred]
      > >> want to do the same in VB.Net , i need to know how to[/color][/color]
      > sent[color=green][color=darkred]
      > >> the authentication in vb.net "
      > >> .Item(cdoSMTPAu thenticate) = cdoBasic"
      > >>
      > >>
      > >>
      > >>
      > >> VB
      > >> -------------------------------------------------------
      > >>
      > >> Dim iMsg as New CDO.Message
      > >> Dim iConf as New CDO.Configurati on
      > >>
      > >> Dim Flds as ADODB.Fields
      > >> Set Flds = iConf.Fields
      > >>
      > >> With Flds
      > >> .Item(cdoSendUs ingMethod) = cdoSendUsingPor t
      > >> .Item(cdoSMTPSe rverName)
      > >> = "somehost@micro soft.com"
      > >> .Item(cdoSMTPCo nnectionTimeout ) = 10 ' quick timeout
      > >> .Item(cdoSMTPAu thenticate) = cdoBasic
      > >> .Item(cdoSendUs erName) = "username"
      > >> .Item(cdoSendPa ssword) = "password"
      > >> .Item(cdoURLPro xyServer) = "server:80"
      > >> .Item(cdoURLPro xyBypass) = "<local>"
      > >> .Item(cdoURLGet LatestVersion) = True
      > >> .Update
      > >> End With
      > >>
      > >> With iMsg
      > >> Set .Configuration = iConf
      > >> .To = """User A"" <userA@microsof t.com>"
      > >> .From = """User B"" <userB@microsof t.com>"
      > >> .Subject = "Hows it going? I've attached my web
      > >> page"
      > >> .CreateMHTMLBod y "http://mypage"
      > >> .AddAttachment "C:\files\myboo k.doc"
      > >> .Send
      > >> End With
      > >> -------------------------------------------------------
      > >>
      > >> thanks[/color]
      > >
      > >
      > >.
      > >[/color][/color]


      Comment

      Working...