Jump to content

grantful

Members
  • Content Count

    79
  • Joined

  • Last visited

Everything posted by grantful

  1. grantful

    Send basic email not working for me

    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.
  2. grantful

    Send basic email not working for me

    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
  3. grantful

    Send basic email not working for me

    Thanks remy i will look into it some more tomarry after work.
  4. grantful

    Send basic email not working for me

    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 and android
  5. grantful

    LongClick listbox selected Item

    Is there a way to longclick an item in a listbox ? I need it for IOS and Android. Thanks
  6. 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.
  7. Well Dave sorry to ask that question . I reboot my computer and start over again and it compiles.
  8. Hey Dave I compiled the demo and it works great . I am trying to implement the share into my project and i am getting [DCC Error] Macapi.ObjectiveC.pas(3145): E2003 Undeclared identifier: 'SObjCClassRegistrationFailed' I have looked at the uses clause in the demo and I have the same thing in mine. I am sure i am not including something. Thanks for your help.
  9. Ok thank you for your hard work with that.
  10. Dave that works great. I am wondering about using a 3rd party method(component, pas, class, etc) in the app. I worried about in the future if the Kastri project will be updated to work with newer versions of Delphi . Thanks for your help
  11. Thanks Dave. I thought i could send a file with the share sheet . I am trying to learn 😉
  12. I need to use the iOS scan text feature on my iPhone . https://support.apple.com/guide/iphone/scan-text-and-documents-iph653f28965/ios I am just wondering is there a way to access this and use it in my iOS app thanks
  13. 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
  14. grantful

    Backup MacBook Delphi app and certificates

    Thanks for that info Patrick . I figured there was a good way to do that.
  15. grantful

    Use testflight with Delphi

    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.
  16. grantful

    Use testflight with Delphi

    Thanks for the input i got one pushed up to testflight i had some issues with my certificates but it’s sorted now
  17. grantful

    Use testflight with Delphi

    Thanks Patrick
  18. 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
  19. grantful

    Problem with fdquery when checking active

    thanks for that Serge
  20. grantful

    Trouble installing Ios SDK

    I am new to IOS Delphi I just got Delphi 11 Community edition Got xcode installed on the mac. I am trying to install the iphone simulator sdk. I keep getting Cannot create file "\\?\D:\Documents\Embarcadero\Studio\SDKs\iPhoneSimulator16.4.sdk\usr\include\c++\v1\__string". Access is denied Thanks for any help to fix this.
  21. grantful

    FMX Tabcontrol Tab Hight

    I am working on an app that runs on ios and android. I can not set the tabcontrol tabHight to 70. If I set the tabcontrol1 tab hight to 70 and compile it there it goes back to 0. On form create i try to set it. TabControl1.TabHeight:= 70; I am trying to find something on Mobile Tutorial: Using Tab Components to Display Pages (iOS and Android) - RAD Studio (embarcadero.com) I think i am missing something on how it works. any help with this is greatly appreciated. Thanks
  22. I am trying to show only the records based on the item i click in a listbox. on the onclick item i have procedure TForm2.ListBox1ItemClick(const Sender: TCustomListBox; const Item: TListBoxItem); var drinkid: Integer; begin FDQuery1.SQL.Clear; FDQuery1.SQL.Text := ('select idDrink from drinks where idDrink = :idDrink '); drinkid := FDQuery1.FieldByName('idDrink').AsInteger := listbox1.ItemIndex; showmessage(intToStr(drinkid)); FDQuery1.Open; TabControl1.ActiveTab := TabItem8; end; so if i make this query in the fdQuery1 sql and exacute it all looks good. here is the drinklist listbox I need to replace the From drinks where idDrink = 12910 with the record that is clicked on in the listbox. The detail on the right is the idDrink for each record. I am not sure i am going about this the right way. Thanks for any help with the correct code to get this to work.
  23. Hey thanks for your time and help That dia looks like a good tool i will look at it tonight
×