SendEmail

Ukázka odeslání e-mailu

Popis

declare function EmailCreate dll "ActualDocument" (string): Integer
declare function EmailSetBody dll "ActualDocument" (Integer, string, string): Integer
declare function EmailSetFrom dll "ActualDocument" (Integer, string, string): Integer
declare function EmailAddTo dll "ActualDocument" (Integer, string, string): Integer
declare function EmailAddFileAttachment dll "ActualDocument" (Integer, string, string): Integer
declare function EmailSendAndFree dll "ActualDocument" (Integer): Integer

script OdeslatEmail (): Boolean
var
  Email: Integer
  RetVal: Integer
  ContentType: string
begin
  Result := False
  Email := EmailCreate("Predmet zpravy")
  if Email > 0 then
    RetVal := EmailSetBody(Email, "Prosty text emailu", "")
    RetVal := EmailSetFrom(Email, "odesilatel@leviom.cz", "")
    RetVal := EmailAddTo(Email, "prijemce@leviom.cz", "")

    ContentType := ""
    RetVal := EmailAddFileAttachment(Email, "c:\Temp\Soubor.txt", ContentType)

    RetVal := EmailSendAndFree(Email)
    if RetVal = 1 then
      write("Email byl uspesne odeslan")

      Result := True
    end
  end
end

Ukázky e-mailu.