RE: [Apps-Script] MailApp.send ..... from Googel Sheet zu Google Mail

135 views
Skip to first unread message

cbmserv...@gmail.com

unread,
Dec 9, 2022, 1:58:57 PM12/9/22
to google-apps-sc...@googlegroups.com

You will need to show us your code if you want us to tell you what is wrong with it.

 

Copy/Paste it into the discussion so we can see it.

 

The error is saying that you have a variable called “Text” which you did not define anywhere. Before you use a variable, you need to give it a value first.

 

From: google-apps-sc...@googlegroups.com <google-apps-sc...@googlegroups.com> On Behalf Of EA
Sent: Friday, December 9, 2022 6:45 AM
To: Google Apps Script Community <google-apps-sc...@googlegroups.com>
Subject: [Apps-Script] MailApp.send ..... from Googel Sheet zu Google Mail

 

Hello good afternoon
I want to send a mail from a Google spreadsheet from a Google account, including the content of a specific cell.
I have created a script and in line 17 the following code.
"MailApp.sendEmail(emailAddress, subject, message);"

But when I execute the code I get the following error message.

15:38:46    Errot    
ReferenceError: Text is not defined
mailsenden    @ Code.gs:12

I found this code on the internet.

What is wrong with this code.


Thanks

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/85195bfc-8de9-460b-a382-9673f7d233c5n%40googlegroups.com.

Abhimanyu Kumar Singh

unread,
Dec 10, 2022, 6:59:54 AM12/10/22
to google-apps-sc...@googlegroups.com, cbmserv...@gmail.com
Please use this 

MailApp.sendEmail(emailAddress, subject, message);

On Fri, Dec 9, 2022 at 8:14 PM EA <estfell...@gmail.com> wrote:
Hello good afternoon
I want to send a mail from a Google spreadsheet from a Google account, including the content of a specific cell.
I have created a script and in line 17 the following code.
"MailApp.sendEmail(emailAddress, subject, message);"

But when I execute the code I get the following error message.

15:38:46    Errot    
ReferenceError: Text is not defined
mailsenden    @ Code.gs:12

I found this code on the internet.

What is wrong with this code.


Thanks

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/85195bfc-8de9-460b-a382-9673f7d233c5n%40googlegroups.com.


--
Regards,

Abhimanyu Kr. Singh
Data Analyst
Central Strategic ,Sourcing & finance Team
+91 7903679668
!!The more we sweat in peace , the less we bleed in war!!
!!Nation Security First!!

EA

unread,
Dec 10, 2022, 7:59:51 AM12/10/22
to Google Apps Script Community
  Hello good afternoon

I have found the error. The error was given for this line "MailApp.sendEmail(emailAddress, subject, message);" but the error was in the definition of the variable emailAddress

// email address
var emailRange = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Mail").getRange("A1");
var emailAddress = emailRange.getValues();
Correct is
var emailAddress = emailRange.getValue(); (without the s in .getValue)

Anyway, thanks to all who answered.
Reply all
Reply to author
Forward
0 new messages