Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
728 views
in Technique[技术] by (71.8m points)

MailApp.sendEmail() in Google Apps Script not sending email

We establish Google G Suite for our clients and over the last few weeks, we have found that Google Apps Script does not process the MailApp.sendEmail() as expected. It only happens in new G Suite account and the exact same code in existing account function as expected.

function testemail(){
  MailApp.sendEmail("gordon@........", "TEST", "Hello world");
  return;
}

Email address that we have used are valid email.

Any ideas?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try using GmailApp.sendEmail()

// The code below will send an email with the current date and time.
var now = new Date();
GmailApp.sendEmail("[email protected]", "current time", "The time is: " + now.toString());

which is the recommended one now.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...