google-apps-script
GmailApp
수색…
비고
메일에 첨부 된 CSV 파일 가져 오기
첨부 된 CSV 파일의 형식으로 전자 메일을 통해 일일 보고서를 전송하고 이러한 파일에 액세스하려는 시스템이 있다고 가정합니다.
function getCsvFromGmail() {
// Get the newest Gmail thread based on sender and subject
var gmailThread = GmailApp.search("from:noreply@example.com subject:\"My daily report\"", 0, 1)[0];
// Get the attachments of the latest mail in the thread.
var attachments = gmailThread.getMessages()[gmailThread.getMessageCount() - 1].getAttachments();
// Get and and parse the CSV from the first attachment
var csv = Utilities.parseCsv(attachments[0].getDataAsString());
return csv;
}
Modified text is an extract of the original Stack Overflow Documentation
아래 라이선스 CC BY-SA 3.0
와 제휴하지 않음 Stack Overflow