The problem is not when sending attachments.
It's when trying to use AppleScript to save the attached files.
With 10.12.2 (and 10.12.3) the save attachments AppleScript feature fails.
I reproduce here the script posted as a workaround.
------------------------------------------------------------
# Select messages with attachments to save
# Run the script to save the files in the folder defined below
# Of course you may define an other path.
# define the storage folder
set POSIXDestFolder to POSIX path of (path to downloads folder)
set {theApp, mt, mi} to {"Mail", 3, 13}
tell application id "com.apple.systemevents" to tell process theApp
set frontmost to true
tell menu bar 1
-- name of menu bar items
(*{
01 - "Apple",
02 - "Mail",
03 - "Fichier",
04 - "Édition",
05 - "Présentation",
06 - "Boîte aux lettres",
07 - "Message",
08 - "Format",
09 - "Fenêtre",
10 - "Aide"
}*)
-- name of menu bar item mt
--> "Fichier"
tell menu bar item mt to tell menu 1
-- set theMenuItems to name of menu items
(* {
01 - "Nouveau message"
02 - "Nouvelle fenêtre de visualisation"
03 - "Ouvrir le Message"
04 - "missing value"
05 - "Fermer la fenêtre"
06 - "Tout fermer"
07 - "Fermer l’onglet"
08 - "Enregistrer"
09 - "Enregistrer sous…"
10 - "Enregistrer comme modèle…"
11 - "missing value"
12 - "Joindre des fichiers…"
13 - "Enregistrer les pièces jointes…"
14 - "Coup d’œil sur les pièces jointes…"
15 - "missing value"
16 - "Importer des boîtes aux lettres…"
17 - "missing value"
18 - "Exporter au format PDF…"
19 - "missing value"
20 - "Imprimer…"
}*)
-- name of menu item mi
--> "Enregistrer les pièces jointes…"
click menu item mi
end tell # menu bar item mt
end tell # menu bar 1
tell window 1
-- its name --> "Boîte de réception (899 messages)"
repeat until exists sheet 1
delay 0.02
end repeat
-- class of UI elements --> {splitter group, button, button, button, toolbar, group, static text, sheet}
tell sheet 1
-- class of UI elements --> {button, button, button, group}
-- class of UI elements of group 1 --> {splitter group, group, radio group, pop up button, text field}
keystroke "g" using {command down, shift down}
repeat until exists sheet 1
delay 0.02
end repeat
tell sheet 1
-- class of UI elements --> {static text, combo box, button, button}
tell me to set sysv2 to (system attribute "sys2")
if sysv2 < 11 then
set theTarget to text field 1
else
set theTarget to combo box 1
end if
# Defines the path of the folder where the file must be saved
set value of theTarget to POSIXDestFolder
-- title of buttons --> {"Aller", "Annuler"}
keystroke return # ditto click button 1 (ou Aller)
end tell # sheet 1
-- name of buttons --> {"Enregistrer", "Nouveau dossier", "Annuler"}
click button 1
end tell # sheet 1
end tell # window 1
end tell # system Events & process
------------------------------------------------------------