I have created the following script to add a file to a GMail:
function mySendEMail(NIDMail) {
var mySubject = "This is only a Test";
var myURL = DriveApp.getFileById(NIDMail).getUrl();
var myBody = "Hello World,\n\n";
myBody = myBody + "dddddddddddd\n";
var file = DriveApp.getFileById(NIDMail);
MailApp.sendEmail("xxxxx@googlemail.com", mySubject, myBody, {
attachments: [file.getAs(MimeType.PDF)],
})
}
With this script I add the file per PDF, but how I can add a attachment per Link to GoogleDrive (like with the GDrive-Symbol)?
Greetings