Easy Email Program

updated October 9, 2003 -- thanks to Jerry Muelver for the correction


Call up a user's default email client with fields filled in.

'- email demo
'- be sure to use %20 for all blank spaces
'- mailto=recipient's email address
'- ?subject=subject field
'- &body=content
'- &cc=carbon copy to recipients
'- &bcc=blind carbon copy to recipients

nomainwin
msg$="mailto:carlg@libertybasic.com"
msg$=msg$+"?Subject=Liberty%20BASIC"
msg$=msg$+"&body=Your%20Text%20HERE"
msg$=msg$+"&cc=name@domain.com"
msg$=msg$+"&bcc=somebody@what.net"

'easiest way:
'run "explorer.exe " + chr$(34) + msg$ + chr$(34)

'or, better way:
call RunThis msg$,0

end

sub RunThis RunFile$, hWindow
    RunFile$=RunFile$+chr$(0)
    lpOperation$ = "open" + chr$(0)
    lpParameters$ = "" + chr$(0)
    lpDirectory$ = "" + chr$(0)
    nShowCmd = _SW_SHOWNORMAL

    calldll #shell32, "ShellExecuteA", _
        hWindow as long, _          'parent window
        lpOperation$ as ptr, _      'open or print
        RunFile$ as ptr, _          'file name
        lpParameters$ as ptr, _     'null
        lpDirectory$ as ptr, _      'default directory
        nShowCmd as long, _        'show window flag
        result as long
    if result <= 32 then notice "Error, Address Failure!"
    end sub


Home

Source Code

Utilities

Internet

Games

Graphics

Media Demos

Snippets

DLL's

API Resources

Freeware

LB 4 Companion

Mastering LB 3

LB Workshop

Game Workshop

Links

Index