2014-02-27 157 views
0

我有一個腳本發送電子郵件給提交表單給我的人。但是,我想從「匿名」帳戶發送電子郵件,所以確認電子郵件不會從我的帳戶中獲得。有沒有辦法從不同的帳戶發送它,所以它看起來不像我手動生成所有這些電子郵件。謝謝!MailApp發送Gmail帳戶匿名帳戶

我的腳本是類似以下內容:

if (user = email) { 
    GmailApp.sendEmail(user, subject, message); 
    } 

其中「用戶」是谷歌帳戶提交人,「電子郵件」的是電子郵件地址提交意願的人都發送到確認。

再次,有沒有辦法使GmailApp.sendEmail(from:'Anonymous') ???

回答

0

嗯,我不能完全回答它可以是匿名的。您可以使用「虛擬」帳戶創作該應用程序以遮蓋您的電子郵件地址,但是如果您使用的是商業或教育帳戶,那麼該帳戶實際上並不奏效。此外,您可以通過給電子郵件發送一個「別名」名稱來吸引注意力分散收件人的注意力。

MailApp.sendEmail(userEmail, 
    "Help Desk Ticket", 
    "Thanks for submitting your issue. \n\nWe'll start " + 
    "working on it as soon as possible. \n\nHelp Desk", 
    {name:"Help Desk"}); 
}​ 

這方面最重要的部分是最後一行{名稱的元素:「幫助臺},這使得您的電子郵件‘名’幫助臺,但你仍然可以看到發送的電子郵件地址,如果你的鼠標。在它(這就是爲什麼我建議在開始一個「虛擬」的電子郵件地址)

你可以看到腳本的情況下在本教程:https://developers.google.com/apps-script/articles/helpdesk_tutorial

下面是我如何使用相同的一個例子劇本中的東西:

function mailCheatSheet(copyId,userEmail,mrNumber){ 
     var copyId = copyId; 
     var userEmail = userEmail; 
     var mrNum = mrNumber; 
     // Convert temporary document to PDF by using the getAs blob conversion 
     var pdf = DocsList.getFileById(copyId).getAs("application/pdf"); 
     // Attach PDF and send the email 
     var subject = "SA Funding request by: "+userEmail; 
     var body = userEmail +" has submitted a SA Funding Inquiry for " +mrNumber +", which is attached to this email. \n" 
      +"Please ensure there are no errors before printing. \n" 
      +"If there are errors, please notify: [email protected] \n\n"; 
     MailApp.sendEmail(userEmail, subject, body, {name: 'SA Worksheet Helperbot', htmlBody: body, attachments: pdf}); 
     // Delete temp file 
     DocsList.getFileById(copyId).setTrashed(true); 
    } 

如果你只是想讓它看起來像你沒有整天坐在電子郵件迴應中(我假設你的老闆認爲你正在做一些有用的事情),那麼你可以添加別名

var body = userEmail +" has submitted a SA Funding Inquiry for " +mrNumber +", which is attached to this email. \n" 
     +"Please ensure there are no errors before printing." 
     +"\n\nThis email was automatically authored by Form Helperbot. If there is an error, please report it to: [email protected]"  
    MailApp.sendEmail(userEmail, subject, body,{name: 'Form Helperbot',htmlBody: body, attachments: pdf}); 
0

如果你想從一個匿名帳戶發送只是因爲你不想收到的答覆,這可能是:你的GmailApp方法,並在電子郵件正文中的這樣的底部添加一個聲明行在電子郵件通知中指定一個虛擬回覆地址是一個更好的主意。

MailApp.sendEmail(userEmail, subject, body, {name: 'SA Worksheet Helperbot', htmlBody: body, attachments: pdf, replyTo: [email protected]});