My guess is based on this: MSDN's CDONTS.newmail documentation
Basically, you have:
The send format says it wants:
(optional) From as String,
(optional) To as String,
(optional) Subject as String,
(optional) Body as Object or String,
(optional) Importance as Long
Importance is a number, not a string, so it's going to throw the type incompatible error, perhaps. The $AttachFile
looks like it would use the ->AttachFile method. Keep in mind I haven't tested this.
Any reason why you aren't using Mail::Sender
or something a little more perl-ish? It works great for me on Windows and Linux. Good luck.