Hi Jon,
this ist the procedure to send email.
Do not be confused with sclass and szone, this are variables to send alarm 
notifications only to certain recipients, according to alarm class and alarm 
zone.
What is important ist the bash script dasmail that is called with TProcess 
(sendmail -v -t < /tmp/mail/mail.txt)
The list of recipients is in the TStringList SL_rcpt
The mail has only a subject, but I am sure you will easily find out how to add 
an email body

procedure send_mail(s:string);
    var smtp:TProcess; azone,aclass:char; F:Text;
        i,j:byte; sclass,szone,sadr,S0:string; inzone,inclass:boolean;
    begin
        smtp:=TProcess.Create(nil);
        smtp.CommandLine:='dasmail';  // script must exist in 
/usr/local/bin/dasmail ('sendmail -v -t < /tmp/mail/mail.txt);
        smtp.Options := smtp.Options + [poWaitOnExit];
        //writeln(s);
        azone:=s[1]; aclass:=s[2]; delete(s,1,2);
        AssignFile(F,'/tmp/mail/mail.txt'); Rewrite(F);
        S0:='To:';
        for i:=0 to SL_rcpt.Count-1 do begin
            inzone:=false; inclass:=false;
            sadr:=SL_rcpt[i]; szone:=SL_rcptzone[i]; sclass:=SL_rcptclass[i];
            for j:=1 to length(sclass) do if sclass[j]=aclass then 
inclass:=true;
            for j:=1 to length(szone) do if szone[j]=azone then inzone:=true;
            if inzone and inclass then S0:=S0+sadr+',';
        end;
        Writeln(F,S0); //write TO: line
        Writeln(F,'From:'+from_adr); //write FROM: line
        Writeln(F,'Subject:'+s);
        Close(F);

        smtp.Execute; smtp.Free;
  end;

Mit freundlichem Gruß / Yours sincerely / Cordialement

Christian Sporer


Grüntenstr.18
80686 München
Tel.:  +(49) 89 54217952
Fax.: +(49) 89 52389119


-----Ursprüngliche Nachricht-----
Von: Jon Trepte via synalist-public 
[mailto:synalist-public@lists.sourceforge.net] 
Gesendet: Montag, 5. Juni 2023 21:30
An: Ararat Synapse
Cc: Jon Trepte
Betreff: Re: [Synalist] Synapse 40

Hi Christian,
Yes please, that would be fantastic, thank you.
Jon


On 5 Jun 2023, at 22:53, S.C.T.N GmbH <message...@sctn.de> wrote:

Why are you not using SSMTP that has all the features included:
https://wiki.debian.org/sSMTP 

Mit freundlichem Gruß / Yours sincerely / Cordialement

Christian Sporer


Grüntenstr.18
80686 München
Tel.:  +(49) 89 54217952
Fax.: +(49) 89 52389119

-----Ursprüngliche Nachricht-----
Von: Jon Trepte via synalist-public
[mailto:synalist-public@lists.sourceforge.net] 
Gesendet: Montag, 5. Juni 2023 18:40
An: synalist-public@lists.sourceforge.net
Cc: Jon Trepte
Betreff: [Synalist] Synapse 40

Hi,
I'm trying to send an Email on my Raspberry PI 4 but I get the following
error when I try to send an Email
It fails at blcksock.TTCPBlockSocket.SSLDoConnect which seems to call
TCustomSSL.Connect      

IError: -2,SSL/TLS support is not compiled!
EXCEPTION: Synapse TCP/IP Socket error -2: SSL/TLS support is not compiled!

 ResultCode: 0
ResultString: 
 FullResult: 
   AuthDone: FALSE


I'm very new to this so any help as to why this is happening would be
appreciated.
Many thanks
Jon




_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public



_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public



_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public



_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to