Email

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

    Email

    I currently have the following VB code in a MS Access Database which I use
    to send emails. Nonetheless, it opens Outlook and I would like it to send an
    email using Outlook Express. Could anyone please oblige in ammending the
    code for me, so that it uses Outlook Express 5?

    Thanks

    ______________

    Private Sub cmdSendEmail_Cl ick()
    Dim objOutlook As Express.Applica tion
    Dim objOutlookMsg As Outlook.MailIte m
    Dim objOutlookRecip As Outlook.Recipie nt
    Dim objOutlookAttac h As Outlook.Attachm ent

    ' Create the Outlook session.
    Set objOutlook = CreateObject("O utlook.Applicat ion")

    ' Create the message.
    Set objOutlookMsg = objOutlook.Crea teItem(olMailIt em)

    With objOutlookMsg
    ' Add the To recipient(s) to the message.
    Set objOutlookRecip = .Recipients.Add (Me.EMail)
    objOutlookRecip .Type = olTo

    .Display
    End With
    Set objOutlook = Nothing
    End Sub


  • M. Posseth

    #2
    Re: Email

    well as far s i know it isn`t possible to send e-mails with outlook express
    like this

    the best you can get is using a mailto command in a shell ( this will open
    the default mail proggy with a message )

    i used the vbsendmail.dll from freevbcode.com to send e-mail messages from
    my proggy`s it is free and comes with sourcecode

    i retrieve the default SMTP server, and users e-mail adress from the
    registry , feed this to the sendmail class and send my message

    you can send even atachments , pictures , htmkl formated mail etc etc etc





    regards

    M. Posseth [MCP]


    "Neil Greenough" <neilgreenough@ btopenworld.com > wrote in message
    news:cegm4k$23$ 1@hercules.btin ternet.com...[color=blue]
    > I currently have the following VB code in a MS Access Database which I use
    > to send emails. Nonetheless, it opens Outlook and I would like it to send[/color]
    an[color=blue]
    > email using Outlook Express. Could anyone please oblige in ammending the
    > code for me, so that it uses Outlook Express 5?
    >
    > Thanks
    >
    > ______________
    >
    > Private Sub cmdSendEmail_Cl ick()
    > Dim objOutlook As Express.Applica tion
    > Dim objOutlookMsg As Outlook.MailIte m
    > Dim objOutlookRecip As Outlook.Recipie nt
    > Dim objOutlookAttac h As Outlook.Attachm ent
    >
    > ' Create the Outlook session.
    > Set objOutlook = CreateObject("O utlook.Applicat ion")
    >
    > ' Create the message.
    > Set objOutlookMsg = objOutlook.Crea teItem(olMailIt em)
    >
    > With objOutlookMsg
    > ' Add the To recipient(s) to the message.
    > Set objOutlookRecip = .Recipients.Add (Me.EMail)
    > objOutlookRecip .Type = olTo
    >
    > .Display
    > End With
    > Set objOutlook = Nothing
    > End Sub
    >
    >[/color]


    Comment

    • preben nielsen

      #3
      Re: Email


      "Neil Greenough" <neilgreenough@ btopenworld.com > skrev i en
      meddelelse news:cegm4k$23$ 1@hercules.btin ternet.com...[color=blue]
      > I currently have the following VB code in a MS Access Database[/color]
      which I use[color=blue]
      > to send emails. Nonetheless, it opens Outlook and I would like[/color]
      it to send an[color=blue]
      > email using Outlook Express. Could anyone please oblige in[/color]
      ammending the[color=blue]
      > code for me, so that it uses Outlook Express 5?[/color]

      Outlook Express does not expose an interface so you cannot do it
      that way !


      --
      /\ preben nielsen
      \/\ prel@post.tele. dk


      Comment

      • the Wiz

        #4
        Re: Email

        "Neil Greenough" <neilgreenough@ btopenworld.com > wrote:
        [color=blue]
        >I currently have the following VB code in a MS Access Database which I use
        >to send emails. Nonetheless, it opens Outlook and I would like it to send an
        >email using Outlook Express. Could anyone please oblige in ammending the
        >code for me, so that it uses Outlook Express 5?
        >
        >Thanks[/color]

        Forget Outlook / Express and use an SMTP control to send mail directly. There's
        a free control at www.ostrosoft.com

        More about me: http://www.jecarter.com/
        VB3/VB6/C/PowerBasic source code: http://www.jecarter.com/programs.html
        Freeware for the Palm with NS Basic source code: http://nsb.jecarter.com
        Drivers for Pablo graphics tablet and JamCam cameras: http://home.earthlink.net/~mwbt/
        Email here: http://www.jecarter.com/contactme.htm

        Comment

        Working...