sendEmail do not attach file

Hello! I can`t attach files to sending message. an email is sent and received without error, but there are no attachments. I tried gmail and local server (hMailServer). What I do wrong? here is my code:[code]filepath=system.file.getTempFile(“txt”)
system.file.writeFile(filepath,“this is tested file”)

subject=“Test”
body=“this is to test mail send \n” + filepath + “\n”
html=0
attachmentName1=“ping.txt”
attachmentData1=system.file.readFileAsBytes(filepath)
username1="test@192.168.1.51"
password1=“test”

system.net.sendEmail(“192.168.1.51”,"test@192.168.1.51",subject,body,html,[“test@192.168.1.51”],attachmentName=[attachmentName1],attachmentData=[attachmentData1],username=username1,password=password1)[/code]

With best regards, Porev Alexander

Hi kramar,

I think that your problem is with the sintaxis you used…

This code works in my script without error and sends two print screens by email:

[color=#0000FF]
Window1 = system.gui.getWindow(“Month”)
name_window1 = “Month.png”
system.print.printToImage(Window1,name_window1)

Window2 = system.gui.getWindow(“Year”)
name_window2 = “Year.png”
system.print.printToImage(Window2,name_window2)

file_Name1 = “Month.png”
file_Data1 = fpmi.file.readFileAsBytes(name_window1)

file_Name2 = “Year.png”
file_Data2 = fpmi.file.readFileAsBytes(name_window2)

system.net.sendEmail(“xxx”,“xxx”,“xxx”,“xxx”,0,“xxx”,[file_Name1,file_Name2],[file_Data1,file_Data2])[/color]

The problem looks like you wrote [tt]attachmentName=[attachmentName1][/tt] when it should be [tt]attachmentNames=[attachmentName1][/tt]