Email with attachement

Hi,

I don’t understand why the name of my file change when I receive it by email: $dtUF$ufLog_2019_08_28.csv**.bin**
normally I have to receive: Log_2019_08_28.csv

My script:
N$ = “Log_” + T$(7 TO 10) + “" + T$(4 TO 5) + "” + T$(1 TO 2) + “.csv”

SENDMAIL “sfaidi@scadalliance.com;support@scadalliance.com”, “”, “Log journalier”, “&[$dtUF$uf” + N$ + “]”

All script:
T$=TIME$
REM Fichier du log ‘Log_Annee_Mois_Jour.csv’ dans le rWRpertoire ‘/usr’
N$ = “Log_” + T$(7 TO 10) + “" + T$(4 TO 5) + "” + T$(1 TO 2) + “.csv”
OPEN N$ FOR BINARY APPEND AS 1
ONTIMER 1, “GOTO NewLogs”

REM Log au 5 min.
TSET 1, 300
ONDATE 1,“0 0 * * *”,“GOTO NewDay”
REM PRINT “Started”
NewLogs:
REM PRINT “New Logs”
L$ = CHR$(34) + TIME$ + CHR$(34) + ", " + STR$(AI1_DEBIT@)+ ", " + STR$(AI2_PRESSION@)+ ", " + STR$(VOLUME_PULSE@)
REM Plus de donnWRes: L$ = L$ + ", " + “Donnée 2”
L$ = L$ + CHR$(13) + CHR$(10)
PUT 1, L$
END

NewDay:
REM PRINT “New Day”
CLOSE 1
SENDMAIL “sfaidi@scadalliance.com;support@scadalliance.com”, “”, “Log journalier”, “&[$dtUF$uf” + N$ + “]”

//&[$dtUF$uf" + N$ + “]”
//gestiondeseaux@ville.paspebiac.ca alarme et rapport
//urbanisme@villepaspebiac.ca rapport

T$=TIME$
N$ = “Log_” + T$(7 TO 10) + “" + T$(4 TO 5) + "” + T$(1 TO 2) + “.csv”
OPEN N$ FOR BINARY OUTPUT AS 1
REM EntWBte du Log
L$ = CHR$(34) + “Date et heure” + CHR$(34) + ", " + “Debit du puits (en L/sec)” + ", " + “Pression (en Psi)”+ ", " + “Volume (en m³)”+ CHR$(13) + CHR$(10)
REM Plus de donnWRes: L$ = L$ + ", " + “Entête 2”
L$ = L$ + CHR$(13) + CHR$(10)
PUT 1, L$
END

Hello,

you should be able to fix this by using the $fn followed by your N$.

Here’s an example I made earlier for naming a file by date.

filename dependent on date through email.txt (785 Bytes)

The output for in an email looked like this

image

Thanks, it works now,

Another question, I think since I installed the FW 13.3s0 the IC no longer works! can you check plz.
MOVED TO STAFF NOTE (262 KB)
MOVED TO STAFF NOTE (75 KB)

Hi @SamFai

Can you clarify what you mean when you say the IC no longer works? What errors are you seeing?

I put input 3 on ON and OFF, but CI3 does not change (always = 1)

I found the mistake, the type was Boolean.

Oh ok, glad we could get it working again!