Simplest Code for E-Mail App Registration

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

    #1

    Simplest Code for E-Mail App Registration

    How would I go about creating the simplest routine in VB 6.0 to have a user
    E-Mail me the application name, date installed and his/her E-Mail Address ?


  • Steve Gerrard

    #2
    Re: Simplest Code for E-Mail App Registration


    "dave" <dave268@mindsp ring.com> wrote in message
    news:F3BKc.3081 $iK.1335@newsre ad2.news.atl.ea rthlink.net...[color=blue]
    > How would I go about creating the simplest routine in VB 6.0 to have a[/color]
    user[color=blue]
    > E-Mail me the application name, date installed and his/her E-Mail[/color]
    Address ?[color=blue]
    >
    >[/color]

    For a simple e-mail message, try this. It will pop up the user's email
    program, with the To, Subject, and Body filled in, ready for them to
    send. Their message will contain their email address as the sender. This
    route avoids hassling with email security, etc. and gives the user the
    chance to add to the email if desired.

    Private Declare Function ShellExecute Lib "shell32.dl l" _
    Alias "ShellExecu teA" ( _
    ByVal hwnd As Long, _
    ByVal lpOperation As String, _
    ByVal lpFile As String, _
    ByVal lpParameters As String, _
    ByVal lpDirectory As String, _
    ByVal nShowCmd As Long) As Long

    Private Sub Command1_Click( )
    Dim strCmd As String

    strCmd = "mailto:"
    strCmd = strCmd & "anybody@anypla ce.com"
    strCmd = strCmd & "?subject=Regis tration"
    strCmd = strCmd & "&body=" & App.Title & "; " & Date

    ShellExecute Me.hwnd, "Open", strCmd, _
    vbNullString, vbNullString, vbNormalFocus

    End Sub


    Comment

    • dave

      #3
      Re: Simplest Code for E-Mail App Registration


      "Steve Gerrard" <notstevegerrar d@comcast.net> wrote in message
      news:DY6dnUoTy8 DfamfdRVn-tw@comcast.com. ..[color=blue]
      >
      > "dave" <dave268@mindsp ring.com> wrote in message
      > news:F3BKc.3081 $iK.1335@newsre ad2.news.atl.ea rthlink.net...[color=green]
      > > How would I go about creating the simplest routine in VB 6.0 to have a[/color]
      > user[color=green]
      > > E-Mail me the application name, date installed and his/her E-Mail[/color]
      > Address ?[color=green]
      > >
      > >[/color]
      >
      > For a simple e-mail message, try this. It will pop up the user's email
      > program, with the To, Subject, and Body filled in, ready for them to
      > send. Their message will contain their email address as the sender. This
      > route avoids hassling with email security, etc. and gives the user the
      > chance to add to the email if desired.
      >
      > Private Declare Function ShellExecute Lib "shell32.dl l" _
      > Alias "ShellExecu teA" ( _
      > ByVal hwnd As Long, _
      > ByVal lpOperation As String, _
      > ByVal lpFile As String, _
      > ByVal lpParameters As String, _
      > ByVal lpDirectory As String, _
      > ByVal nShowCmd As Long) As Long
      >
      > Private Sub Command1_Click( )
      > Dim strCmd As String
      >
      > strCmd = "mailto:"
      > strCmd = strCmd & "anybody@anypla ce.com"
      > strCmd = strCmd & "?subject=Regis tration"
      > strCmd = strCmd & "&body=" & App.Title & "; " & Date
      >
      > ShellExecute Me.hwnd, "Open", strCmd, _
      > vbNullString, vbNullString, vbNormalFocus
      >
      > End Sub
      >
      >[/color]

      Thanks, this works nicely.
      I got a bit frustrated when I couldn't get the string to begin on the next
      line where I wanted it to.
      I tried:

      strCmd = "mailto:"
      strCmd = strCmd & "anybody@anypla ce.com"
      strCmd = strCmd & "?subject=Regis tration"
      strCmd = strCmd & "&body=" & App.Title & "; " & Date
      strCmd = strCmd & Chr(13) & "Name: "
      strCmd = strCmd & Chr(13) & "EMail: "

      ....But Name: and EMail would appear right after the date and not on the
      next 2 lines as would usually
      be the case with strings. Where can one find info on the string command
      requirements for the shell32.dll

      Thanks again.


      Comment

      • Steve Gerrard

        #4
        Re: Simplest Code for E-Mail App Registration


        "dave" <dave268@mindsp ring.com> wrote in message
        news:6IHKc.3538 $iK.184@newsrea d2.news.atl.ear thlink.net...[color=blue]
        >
        > I got a bit frustrated when I couldn't get the string to begin on the[/color]
        next[color=blue]
        > line where I wanted it to.
        > I tried:
        >
        > strCmd = strCmd & "&body=" & App.Title & "; " & Date
        > strCmd = strCmd & Chr(13) & "Name: "
        > strCmd = strCmd & Chr(13) & "EMail: "
        >
        >Where can one find info on the string command
        > requirements for the shell32.dll
        >[/color]
        Actually, its not shell32.dll or ShellExecute that you care about, but
        the mailto: command, which is an HTML command.

        You can use the HTML style of encoding to include special characters,
        such as the CRLF pair. I think there is a limit of 255 chars on the
        body.

        strCmd = strCmd & "&body=" & App.Title & "; " & Date
        strCmd = strCmd & "%0D%0AThis is line two."


        Comment

        • preben nielsen

          #5
          Re: Simplest Code for E-Mail App Registration


          "dave" <dave268@mindsp ring.com> skrev i en meddelelse
          news:6IHKc.3538 $iK.184@newsrea d2.news.atl.ear thlink.net...
          [color=blue]
          > Thanks, this works nicely.
          > I got a bit frustrated when I couldn't get the string to begin[/color]
          on the next[color=blue]
          > line where I wanted it to.
          > I tried:
          >
          > strCmd = "mailto:"
          > strCmd = strCmd & "anybody@anypla ce.com"
          > strCmd = strCmd & "?subject=Regis tration"
          > strCmd = strCmd & "&body=" & App.Title & "; " & Date
          > strCmd = strCmd & Chr(13) & "Name: "
          > strCmd = strCmd & Chr(13) & "EMail: "
          >
          > ....But Name: and EMail would appear right after the date[/color]
          and not on the[color=blue]
          > next 2 lines as would usually[/color]


          Try vbLf or vbCrLf instead of Chr(13). Might work........


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


          Comment

          • dave

            #6
            Re: Simplest Code for E-Mail App Registration

            This Works ! Thanks so much !
            Is there a good book or an online resource on using dll's/windows applicatio
            programming interface (API) ?

            "Steve Gerrard" <notstevegerrar d@comcast.net> wrote in message
            news:0sudnb9TgZ x3z2bdRVn-jw@comcast.com. ..[color=blue]
            >
            > "dave" <dave268@mindsp ring.com> wrote in message
            > news:6IHKc.3538 $iK.184@newsrea d2.news.atl.ear thlink.net...[color=green]
            > >
            > > I got a bit frustrated when I couldn't get the string to begin on the[/color]
            > next[color=green]
            > > line where I wanted it to.
            > > I tried:
            > >
            > > strCmd = strCmd & "&body=" & App.Title & "; " & Date
            > > strCmd = strCmd & Chr(13) & "Name: "
            > > strCmd = strCmd & Chr(13) & "EMail: "
            > >
            > >Where can one find info on the string command
            > > requirements for the shell32.dll
            > >[/color]
            > Actually, its not shell32.dll or ShellExecute that you care about, but
            > the mailto: command, which is an HTML command.
            >
            > You can use the HTML style of encoding to include special characters,
            > such as the CRLF pair. I think there is a limit of 255 chars on the
            > body.
            >
            > strCmd = strCmd & "&body=" & App.Title & "; " & Date
            > strCmd = strCmd & "%0D%0AThis is line two."
            >
            >[/color]


            Comment

            Working...