• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Please Help, How to Send Email from google spreadsheet

uranus99

New Member
Hello, can someone help me to make VBA Macros code to send email from google spreadsheet.
i wanna create a button so when i click that, i can send email to xxxx@gmail.com (only this email)
The subject is C9
The message is A1:I10
This is my file. i hope someone will gladly help me
thanksss
 

Attachments

  • Send Email in Google Spreadsheet.xlsx
    11.5 KB · Views: 1
I had tried but this code failed to display the message that i want to send.
can anyone fix this??

Code:
function CustomEmail() {
    var sheet = SpreadsheetApp.getActiveSheet();
    var range = sheet.getRange("A1:I10");
    //var UserData = range.getValues();
    //for (i in UserData) {
    //var row = UserData[i];
    var subject = sheet.getRange("C9");
    var subject1 = subject.getValue();
    var message = sheet.getRange("A1:I10");
    var message1 = message.getValue();
    MailApp.sendEmail("xxxx@gmail.com", subject1, message1);
    }
 
This is Excel forum. Ask in Google forum.
VBA Macros code to send email from google spreadsheet.
Google Spreadsheet can't use VBA, and will require AppScript (variant of Java Script).

But right off the bat, I'd recommend replacing MailApp with GMailApp.
 
Back
Top