Send an attachement email

I’m trying to send an attachement email but, when I send my email, I don’t receive the attachement

Here is my code:

    smtp_server = "test2"

sender = ""
subject_mail = "Rapport journalier de l'hyperviseur"

body_mail = "Vous avez en PJ le rapport journalier de l'hyperviseur, salutation"
recipients = ["",self.getSibling("TextField").props.text]

file_name = "Rapport journalier de l'hyperviseur.pdf"
file_data = system.file.readFileAsBytes("C:\Users\ADMIN\Desktop\Rapport ignition\Rapport journalier de l'hyperviseur.pdf")
	smtpProfile = smtp_server, fromAddr = sender, 
	subject = subject_mail, body = body_mail, html = 1, 
	to = recipients, attachementNames = [file_name], 
	attachementData = [file_data])

You have an extra “e” in your spelling of “attachment”. English ≠ French :grin:


Thanks :slight_smile: