Topic: A little help with "SQLExecute"
Dear all,i am building an autofill for my sendmail, so when i select a value on a tablegrid i can click a button and it should send an automatic email
Right now my code is stuck at:
procedure main_btemailfo_OnAfterClick (Sender: string);
var
sFile: string;
sEmail: string;
sID: string;
begin
main.btemailfo.Enabled := False;
main.btemailfo.Caption := 'Please wait...';
semail := SQLexecute ('SELECT clientes.email FROM clientes where main.Tabela_Main.sqlValue');
sid := main.Tabela_Main.sqlValue;
sFile := main.frxPDFExport1.FileName;
if FileExists(sFile) then
if SendMail('smtp.portugalmail.pt', 'xxxxxxxxxxxx@portugalmail.pt', 'xxxxxxxxxx1', 465 , 'xxxxxxxxx@portugalmail.pt', 'sEmail' , 'subject', 'your text', sFile) then
ShowMessage('Message sent');
main.btemailfo.Enabled := true;
main.btemailfo.Caption := 'Email ';
end;
sEmail is the value i am looking for, i created an sID because if i use sqlvalue on main.Tabela_main i get the right ID for the job.
What i am trying to acomplish is retreiving an SQLexecute statement that uses this ID to fetch clientes.email data from table clientes
Can anyone help me?
Thanks