$PBExportHeader$f_email.srf global type f_email from function_object end type forward prototypes global function integer f_email (string as_email_title, string as_email_add, string as_email_attach) end prototypes global function integer f_email (string as_email_title, string as_email_add, string as_email_attach);/************************************ function:sent email by outlook paramdesc:as_email_add :email as_email_title : as_email_attach : ************************************/ mailSession LmSes mailReturnCode LmRet mailMessage LmMsg mailFileDescription LmAttach string Ls_ret int Li_send LmSes = Create mailSession LmRet = LmSes.mailLogon ( mailNewSession! ) If LmRet <> mailReturnSuccess! Then MessageBox ( "Mail Logon ", 'Return Code <> mailReturnSuccess! ' ) LmSes.maillogoff() destroy LmSes return 1 End If LmMsg.Subject = as_email_title LmMsg.notetext = ' ' LmMsg.Recipient[1].name=as_email_add LmAttach.FileType = mailAttach! LmAttach.PathName = as_email_attach LmAttach.FileName = as_email_attach Li_send=Li_send+1 LmMsg.AttachmentFile[1] = LmAttach LmRet = LmSes.mailsend ( LmMsg ) if LmRet <> mailReturnSuccess! then LmSes.maillogoff() destroy LmSes return 1 end if LmSes.maillogoff() destroy LmSes return 1 end function