Jump to content

grantful

Members
  • Content Count

    79
  • Joined

  • Last visited

Posts posted by grantful


  1. well on android in debug i got

    constructor TIdSSLContext.Create;
    begin
      inherited Create;
      //an exception here probably means that you are using the wrong version
      //of the openssl libraries. refer to comments at the top of this file.
      if not LoadOpenSSLLibrary then begin
        raise EIdOSSLCouldNotLoadSSLLibrary.Create(RSOSSLCouldNotLoadSSLLibrary);
      end;
      fVerifyMode := [];
      fMode := sslmUnassigned;
      fSessionId := 1;
    end;

     

    I will have to check this out


  2. Thanks for all comments and corrected code .

     

    Remy I was using (nil)  and trying to take care of freeing the objects.

     

    I noticed you used (smpt)

     

    what advantage is there to doing it that way. 

    Thanks i am trying to learn

     

     

     

    I am trying to use this code but

     

    on ios 

    ios.thumb.jpg.b2a094aaa7731183fbc4b95ab35421d7.jpg

     

    and android 

    and.thumb.jpg.3fbaf94fa0c3c1fac2a39d86870308f4.jpg


  3. i am using Delphi 11CE

     

    I am trying to send a basic email with indy;

    procedure SendTestEmail2;
    var
      SMTP: TIdSMTP;
      Message: TIdMessage;
      SSLHandler: TIdSSLIOHandlerSocketOpenSSL;
    begin
      SMTP := TIdSMTP.Create(nil);
      Message := TIdMessage.Create(nil);
      //SSLHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
      SSLHandler.SSLOptions.Method := sslvTLSv1_2;  // or sslvTLSv1, sslvTLSv1_1, etc.
    
      try
        SSLHandler.SSLOptions.Method := sslvTLSv1_2;
        SSLHandler.SSLOptions.Mode := sslmUnassigned;
        SSLHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
    
        SMTP.IOHandler := SSLHandler;
        SMTP.Host := 'smtp.gmail.com';
    
        SMTP.Port := 465;  // or 465, depending on your server
        SMTP.UseTLS := utUseExplicitTLS;  // or utUseImplicitTLS
    
        SMTP.Username := 'UserName';
        SMTP.Password := 'Pass';
    
        Message.From.Address := 'men@gmail.com';
        Message.Recipients.EMailAddresses := 'grantful@yahoo.com';
        Message.Subject := 'Test Subject';
        Message.Body.Add('Test message.');
    
        try
          SMTP.Connect;
          SMTP.Send(Message);
        except
          on E: Exception do
          begin
            ShowMessage('Error: ' + E.Message);
          end;
        end;
      finally
        SMTP.Free;
        Message.Free;
        SSLHandler.Free;
      end;
    end;

    Never worked with indy before .  

    on the android phone i get Error Sending Email External exception 4e

    on my iphone i get error Sending Email: acces violation  at address0000000000104b-d0788

    Thanks for any help and or point me to a working example.


  4. I have a sqlite database file( app.s3db)  in my app i wold like to send with share sheet to back up to email ,etc .

     

    I am working on a class to do this but have an error.

     

    unit ShareDatabaseFile;
    
    interface
    
    uses
      System.SysUtils, System.Classes, FMX.Types, FMX.Controls,
      FMX.MediaLibrary.Actions, FMX.Dialogs, FMX.ActnList;
    
    type
      TDatabaseFileSharer = class(TComponent)
      private
        FShareSheet: TShowShareSheetAction;
        FActionList: TActionList;
        procedure DoBeforeExecute(Sender: TObject); // Declaration
      public
        constructor Create(AOwner: TComponent); override;
        destructor Destroy; override;
        procedure ShareDatabaseFile;
      end;
    
    implementation
    
    uses
      System.IOUtils;
    
    { TDatabaseFileSharer }
    
    constructor TDatabaseFileSharer.Create(AOwner: TComponent);
    begin
      inherited;
      FActionList := TActionList.Create(Self);
    
      FShareSheet := TShowShareSheetAction.Create(Self);
      FShareSheet.ActionList := FActionList;
      FShareSheet.OnBeforeExecute := DoBeforeExecute;  // Assignment
    end;
    
    destructor TDatabaseFileSharer.Destroy;
    begin
      FShareSheet.Free;
      FActionList.Free;
      inherited;
    end;
    
    procedure TDatabaseFileSharer.DoBeforeExecute(Sender: TObject);  // Implementation
    var
      DatabaseFilePath: string;
    begin
      DatabaseFilePath := TPath.Combine(TPath.GetDocumentsPath, 'mydatabase.db');
      if TFile.Exists(DatabaseFilePath) then
      begin
        FShareSheet.SharedFileName := DatabaseFilePath;
    
      end
      else
      begin
        ShowMessage('Database file not found.');
        Abort;
      end;
    end;
    
    procedure TDatabaseFileSharer.ShareDatabaseFile;
    begin
      FShareSheet.ExecuteTarget(nil);
    end;
    
    end.

     I am getting undeclared identifier

     

    procedure TDatabaseFileSharer.DoBeforeExecute(Sender: TObject);  // Implementation
    var
      DatabaseFilePath: string;
    begin
      DatabaseFilePath := TPath.Combine(TPath.GetDocumentsPath, 'mydatabase.db');
      if TFile.Exists(DatabaseFilePath) then
      begin
        FShareSheet.SharedFileName := DatabaseFilePath;
    
      end
      else
      begin
        ShowMessage('Database file not found.');
        Abort;
      end;
    end;

    here is the error  FShareSheet.SharedFileName is the undeclared identifier. 

     

    so the .sharedFileName is the issue.

     

    i am looking in the FMX.MediaLibrary.Actions and can not see anything about the shared file name.

     

     

     

    Thanks for any help.


  5. Is there a way to back up my keychain and certificates and my project on the MacBook ?

     

    I am not familiar with a Mac just got one to compile Delphi apps

     

    I use git on windows to back up the Delphi project code

     

    just asking u guys to see if u have any tips or best practice for backing up the Mac with all the keychain ,certificates,ect

     

    Thanks for any suggestions 


  6. Hello all.

    I am trying to learn how to deploy an app to testflight for testing.

    I would like to use testflight to let my friends try my app.

     

    I have been looking around google, youtube  .

     

    Can anyone share how to deploy an app to testflight from delphi.

     

    Thanks for the advice.


  7. I been messing around with an fmx and SQLite app for a while all is good.

     

    I was doing some fdquery work and all of the sudden when I put a check in active to do some visual design I got an error 

     

    That was the other day and I happen to just close out of Delphi.

     

    I open the project back up messing around and compiling in windows and all is good.

     

    iI try to compile to iOS and the app just tries to launch and immediately closes out 

     

    I try to compile to android and same thing.


    if I uncheck the fdquery the app compiles fine on iOS and android.

     

    I look in deployment and the database files are there and the external dir paths look good

     

    i deleted the files and add them back and same thing.

     

     

    I did do a quick app with the same SQLite database and a simple query and it runs fine on android and iOS.

     

    has anyone run into this with fdquery ?

     

    I do not remember the error from the other day.

    It seems to be something to do with the query or the SQLite database file.

     

    any help to troubleshoot this is greatly appreciated.

     

    by the way I closed delphi wen I got the error and did not save changes 

    so no wears error now when I tick the active box in the query

     

    i do remember when I got the error from ticking the active box in the query I tried to compile and the compiler was stating it could not fin the fmx form. ( uMain )

     

     

    sent from my iPhone 

     


  8. It is a SQLite database

     

    Example

    Table (Drinks)

     

    Fields

    idDrink,strDirections,stringrediants1,stringrediants2,stringrediants3,stringrediants4,etc


    so when I click on any record in the listview I need to use the idDrink (integer) and display all the fields

     

    idDrink field is int

    strdrink is string

    stringrediants1,stringrediants2,stringrediants3 is string


    so the strDirections will go into a memo

    the stringrediants3,2,3 etc will go in a memo

     

     

     

×