FUNCTION _GEMS_EmailTo($mailadd) IF LEFT($mailadd,1) = "[" AND RIGHT($mailadd,1) = "]" $mailadd = DBGET($mailadd) END if IF TRIM($mailadd) <> "" _GEMS_Email($mailadd,"","","","") END IF END FUNCTION FUNCTION _GEMS_Email($to,$cc,$subject,$text,$file) ' Separate multiple addresses with ; and put %0A in text for a new line ' File attachments only work with certain mail clients (e.g. Outlook) LOCAL $mailto $mailto = "mailto:"|$to|"?cc="|$cc|"&subject="|$subject|"&body="|$text IF $file <> "" $mailto = $mailto|"&file="|chr(34)|$file|chr(34) END IF _GEMS_ShellEx("open",$mailto,"",1) END FUNCTION FUNCTION _GEMS_ShellEx($op,$command,$param,#mode) LOCAL #shell32dll DLL LOAD "shell32.dll" #shell32dll DLL CALL #shell32dll FUNCTION "ShellExecuteA" STACK "LPPPPL" \ #GEMS_SWWinH DOSPTR($op) DOSPTR($command) DOSPTR($param) 0 #mode DLL UNLOAD #shell32dll RETURN GETREG(AX) END FUNCTION