Apps Script Mailapp.sendEmail not working from Google Workspace account

We are a non-profit Organisation that has been using Sheets, Forms and Apps Script, some of which send out emails using MailApp.sendEmail() from a standard Google account for a number of years with no problem.

We have now obtained a Google Workspace account with the intent to migrate our operational sheets/forms/scripts to the new Workspace as Google Workspace has much higher account limits. One of the first things we have tried, is to test out the script mailing functionality and it simply does not work from any of our Google Workspace accounts. Note general user emails are working fine from within our workspace account as we have sent many from various internal accounts i.e. our general email set-up is functional.

Below is a simple code block that we used to test. In order to provide more information, the script tries to send a test email to four separate email accounts – two external mail accounts using different destination mail servers and two google accounts, one internal to the workspace domain and one external (@gmail.com). The script executes fine, the email appears in the sent folder of the sending account (the one running the script), but nothing arrives at any of the destinations. The code is shown below (with email addresses changed for security):

function testEmail() {
  Logger.log('testEmail START');
  var address = '[email protected],[email protected],[email protected],[email protected]';
  
  // Create the html version of the response email    
  var html_mailBody = 'Hello this is a test email<br><br>';

  // Create the text version of the response email
  var text_mailBody = 'Hello this is a test emailnn';
  
  // Send the email
  MailApp.sendEmail({
    to: address,
    subject: "Test Email to three different recipients",
    body: text_mailBody,
    htmlBody: html_mailBody
  });
  Logger.log('testEmail END');
}

In trying to investigate further, we looked at the email logs in our Google Workspace Admin Console and what we see is the the email is listed as “bounced” for each of the recipient addresses and “delivered to Gmail mailbox” for the sender i.e. placed in the Sent folder. Upon expanding the logs for the bounced mails all we see are “delivered to an SMTP server” immediately followed by “bounced”. There are no details of server addresses and as no actual bounce message is received, we have no email headers to look at for bounced messages.

We have looked on the web and have found a few references to this type of behaviour but the only “answer” seems to be “use GmailApp instead” which we’re sure will work but we’d expect to see more “noise” if MailApp didn’t work from a Google Workspace account so we suspect that we may have something set wrong in our Workspace Domain and we would prefer not to have to adjust our scripts when migrating.

We have reached out to Workspace support but we are going around in circles so thought we would see if anybody else has seen this or as a minimum, get confirmation that MailApp does currently work from A Google Workspace account.

New contributor

Paul Rousell is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật