Alpha Video Training
Results 1 to 4 of 4

Thread: Open your Email program from a Button on your Form

  1. #1
    Alpha Software Employee Selwyn Rabins's Avatar
    Real Name
    Selwyn Rabins
    Join Date
    Mar 2000
    Location
    Boston, MA
    Posts
    5,298

    Default Open your Email program from a Button on your Form

    Say you have a table with a field that contains
    email addresses.

    You want to have a button on the form that opens your
    email client, and automatically puts in the email address
    from the field called "email_address".

    To do this, define a new Global Function as follows:


    function email as N(address as C)
    declare shell32 ShellExecuteA LLCCLLL
    email_address = "mailto:"+address
    ShellExecuteA(0,"open",email_address,0,0,1)
    end function


    To call the function:

    Put a button on the form. Put this xbasic in the button:


    email(email_address)

  2. #2
    Jake Vuckovic
    Guest

    Default RE: Open your Email program from a Button on your

    Selwyn,
    With little modification, we can use same function to open EITHER email or browser:

    function webmail as N(address as C)
    declare shell32 ShellExecuteA LLCCLLL
    email_address = "mailto:"+address
    web_address = "http://"+address
    if *any(address,"@") then
    ShellExecuteA(0,"open",email_address,0,0,1)
    else
    ShellExecuteA(0,"open",web_address,0,0,1)
    end if
    end function

    Usage:
    webmail(CharacterString)

    Thanks,
    Of course all credit goes to you.

    Jake

  3. #3
    Matthew Leggett
    Guest

    Default RE: Open your Email program from a Button on your

    Selwyn

    Am I right in saying that the script listed below doesn't care what your email program is?

    Matthew

  4. #4
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: Open your Email program from a Button on your

    It finds the default mail program as set in control panel.

    Bill

Similar Threads

  1. open form from button to top recordno
    By Ian_Edwards in forum Alpha Five Version 6
    Replies: 0
    Last Post: 05-13-2005, 09:17 AM
  2. Form Button to open Netmailer?
    By walhoney in forum Alpha Five Version 5
    Replies: 1
    Last Post: 12-09-2004, 01:21 PM
  3. Button on Form Exceeds Maximum Open Tables
    By Denny Johnson in forum Alpha Five Version 4
    Replies: 3
    Last Post: 01-21-2003, 08:47 AM
  4. Button on Form Exceeds Maximum Open Tables
    By Denny Johnson in forum Alpha Five Version 4
    Replies: 0
    Last Post: 01-20-2003, 08:11 PM
  5. open new form button
    By Lynne Stechschulte in forum Alpha Five Version 4
    Replies: 1
    Last Post: 07-20-2000, 12:08 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •