VB6 and Email capability

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

    VB6 and Email capability

    I have a project within which I need to send an automatically produced
    report to a client list. Can anyone point me to documentation on
    implimenting an email sending routine within a VB6 program? Code samples?

    Thanks

    Sal in Iowa


  • Rowland

    #2
    Re: VB6 and Email capability


    "Salgoud Dell" <nomail@cfu.net > wrote in message
    news:chseav$1p6 $1@news.cfu.net ...[color=blue]
    > I have a project within which I need to send an automatically produced
    > report to a client list. Can anyone point me to documentation on
    > implimenting an email sending routine within a VB6 program? Code samples?
    >
    > Thanks
    >
    > Sal in Iowa
    >[/color]
    Here's a function I used to use ages ago - I've since created a .NET
    version, so I can't gaurantee that it ever worked (!), but it should give
    you some pointers if it doesnt. It makes use of Microsoft's CDO library, so
    you will prob. need that installed - I recommend reading up about it, and
    CDONTS as well - a simple google search should yield loads of results.

    *************** * CODE *************** *
    Public Function fSendMailCDO(sT o As String, sFrom As String, sSubject As
    String, sMessage As String) As Boolean
    'Returns true if the message was sent, else return's false
    'This function cannot guarantee the e-mail was recieved and/or read.
    On Error GoTo errorHandler
    Dim objConf As New CDO.Configurati on
    Dim objMessage As New CDO.Message
    objConf.Fields. Item(cdoSendUsi ngMethod).value = 2
    objConf.Fields. Item(cdoSMTPSer ver).value = "skinner"
    objConf.Fields. Update

    objMessage.Conf iguration = objConf
    objMessage.From = sFrom
    objMessage.To = sTo
    objMessage.HTML Body = sMessage
    objMessage.Subj ect = sSubject
    objMessage.Send

    fSendMailCDO = True
    Exit Function
    errorHandler:
    Select Case err.Number
    Case -2147220977: 'E-mail address rejected
    Debug.Print fGetErrorLogPre fix + vbCrLf + _
    "ERROR: EMAIL ADDRESS REJECTED" + vbCrLf + _
    err.Description + vbCrLf + vbCrLf
    Case Else
    Debug.Print fGetErrorLogPre fix + vbCrLf + _
    "UNHANDLED EXCEPTION in fSendMail" + vbCrLf + _
    CStr(err.Number ) + vbCrLf + _
    err.Description
    End Select
    fSendMailCDO = False
    End Function
    *************** * END CODE *************** *

    HTH,

    Rowland.


    Comment

    • M. Posseth

      #3
      Re: VB6 and Email capability


      use the sendmail.dll from freevbcode

      it is free , comes with source ( VB 6 code ) and is superior to most
      commercial e-mail components
      ( can send html formatted mail , with embedded pictures , can send
      atachments etc etc etc etc )

      if you don`t like external dependancy`s it is even possible to include the
      classes in your own project :-)

      download it here :




      happy coding


      M. Posseth [MCP]

      "Salgoud Dell" <nomail@cfu.net > wrote in message
      news:chseav$1p6 $1@news.cfu.net ...[color=blue]
      > I have a project within which I need to send an automatically produced
      > report to a client list. Can anyone point me to documentation on
      > implimenting an email sending routine within a VB6 program? Code samples?
      >
      > Thanks
      >
      > Sal in Iowa
      >
      >[/color]


      Comment

      • mayayana

        #4
        Re: VB6 and Email capability



        See the email User Control download. It has no
        dependencies - no CDO, no Outlook, no Winsock OCX.
        It's missing a few niceties like multiple recipients,
        CC option, etc., but you can add those easily enough.

        --
        --
        Salgoud Dell <nomail@cfu.net > wrote in message
        news:chseav$1p6 $1@news.cfu.net ...[color=blue]
        > I have a project within which I need to send an automatically produced
        > report to a client list. Can anyone point me to documentation on
        > implimenting an email sending routine within a VB6 program? Code samples?
        >
        > Thanks
        >
        > Sal in Iowa
        >
        >[/color]


        Comment

        • JackFrost

          #5
          Re: VB6 and Email capability

          I use Ostrosofts OSSMTP control
          (http://www.ostrosoft.com/smtp_component.asp)

          It has all the niceties you might expect (CC,BCC, Attachments) and is free.
          Works very nicely most of the time, but you might need to tweak your
          security settings on some machines if they are particularly high.
          I'm using this in a program that sends me an email everyday without fail.

          JackFrost
          "A day without sun is like night."
          "Salgoud Dell" <nomail@cfu.net > wrote in message
          news:chseav$1p6 $1@news.cfu.net ...[color=blue]
          > I have a project within which I need to send an automatically produced
          > report to a client list. Can anyone point me to documentation on
          > implimenting an email sending routine within a VB6 program? Code samples?
          >
          > Thanks
          >
          > Sal in Iowa
          >
          >[/color]


          Comment

          • Salgoud Dell

            #6
            Re: VB6 and Email capability

            To all...
            Thanks to all for the great tips. I now have my VB application sending out
            automatic email reports, efficiently without drawing the wrath of my
            anti-virus program. Your help was and always is greatly appreciated. I hope
            I can return the favor.

            Sal


            "Salgoud Dell" <nomail@cfu.net > wrote in message
            news:chseav$1p6 $1@news.cfu.net ...[color=blue]
            >I have a project within which I need to send an automatically produced
            >report to a client list. Can anyone point me to documentation on
            >implimenting an email sending routine within a VB6 program? Code samples?
            >
            > Thanks
            >
            > Sal in Iowa
            >[/color]


            Comment

            Working...