****************************** StrtMail.prg************************* *** StartMail #DEFINE HKEY_CLASSES_ROOT -2147483648 && (( HKEY ) 0x80000000 ) #DEFINE HKEY_CURRENT_USER -2147483647 && (( HKEY ) 0x80000001 ) #DEFINE HKEY_LOCAL_MACHINE -2147483646 && (( HKEY ) 0x80000002 ) #DEFINE HKEY_USERS -2147483645 && (( HKEY ) 0x80000003 ) FUNCTION StartMail LOCAL lcOpenCommand oControlRegistry1 = CREATEOBJECT("ControlRegistry") ************************************************************************ **** getting th default email client NAME! ********** lcMailClient = ; oControlRegistry1.ReadRegistryString(HKEY_LOCAL_MACHINE,; "Software\Clients\Mail",; "") IF EMPTY(lcMailClient) Aviso("No email client installed") RETURN ENDIF DO CASE CASE lcMailClient = "Exchange" CASE lcMailClient = "Internet Mail and News" CASE lcMailClient = "Outlook Express" CASE lcMailClient = "Microsoft Outlook" OTHERWISE Aviso("Client not supported") ENDCASE *** Gets the command to launch lcString = "Software\Clients\Mail\"+ALLTRIM(lcMailClient)+"\shell\open\command" lcOpenCommand = ; oControlRegistry1.ReadRegistryString(HKEY_LOCAL_MACHINE,; lcString,; "") IF EMPTY(lcOpenCommand) RETURN .F. ENDIF ON ERROR DO Nothing IF !EMPTY(lcOpenCommand) RUN /N1 &lcOpenCommand ENDIF DO ..\Progs\ErrHand.prg RETURN .T. ENDFUNC FUNCTION Nothing && Just that...nothing ENDFUNC