Well not a very inDesign question is it but this will do what you want.
// Send selected files as attachments through outlook on windows
// By Trevor htps://forums.adobe.com/message/6546861#6546861
// Need a custom script , willing to pay for it send me a private message.
var notify = true; // set to true if you want a popup measage to say that the mail is sending
var delay = 1.5 // the number of seconds you want the popup to appear
var ToAddress = "Barack@White-house.org"; // You might need to change this
var MessageSubject = "Howdy Barack, take a look at this"; // You might need to change this
// bodyText set at line 27 Below
var myAttachments = File.openDialog ("Select the files you wish to attach", "All Files: *.*", true);
if (!myAttachments) {
alert("Sorry mate I can't send your attachments if you don't select them\rPlease try again next year\rThanks");
exit();
}
var n, MessageAttachments = [], bodyFileNames = [], fName = "";
for (n = 0; n < myAttachments.length; n++) {
fName = myAttachments.fsName;
MessageAttachments = 'newMail.Attachments.Add("' + fName + '")';
bodyFileNames = fName;
}
MessageAttachments = MessageAttachments.join("\r") + "\r";
bodyFileNames = bodyFileNames.join("\" & vbNewLine & \"");
// the \" & vbNewLine & \" is a way off putting in line feads
MessageBody = "Howdy i spent yonks of time making this. \" & vbNewLine & \"" + bodyFileNames; // You might need to change this
//VBS code very very very heavily based on the answer of ShaddowFox333 http://www.tek-tips.com/viewthread.cfm?qid=728333
myVBS = '''Dim ToAddress
Dim FromAddress
Dim MessageSubject
Dim MessageBody
Dim MessageAttachment
Dim ol, ns, newMail
ToAddress = "''' + ToAddress + '''"
MessageSubject = "''' + MessageSubject + '''"
MessageBody = "''' + MessageBody + '''"
Set ol = CreateObject("Outlook.Application")
Set ns = ol.getNamespace("MAPI")
Set newMail = ol.CreateItem(olMailItem)
newMail.Subject = MessageSubject
newMail.Body = MessageBody & vbCrLf
newMail.RecipIents.Add(ToAddress)
''' +
MessageAttachments + "newMail.Send";
try {
app.doScript (myVBS, ScriptLanguage.VISUAL_BASIC, undefined, UndoModes.AUTO_UNDO);
if (notify) {
var tempFile = new File (Folder.temp + "/" + +new Date + ".vbs");
tempFile.open('w');
tempFile.write('''Set shell = CreateObject("Wscript.Shell")
delay = ''' + delay + '''
shell.Popup "Sending document by outlook", delay, "InDesign Mail Manager", 64
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFile("''' + tempFile.fsName + '''"),DeleteReadOnly
''');
tempFile.close();
tempFile.execute();
}
}
catch (e) {alert ("Drat goofed up")}