to google apps script community

349 views
Skip to first unread message

Johnny Matthews

unread,
Nov 28, 2022, 9:21:52 PM11/28/22
to Google Apps Script Community
Hello i would really appreciate someone who knows how to code in java to help me in google scripts. All i want to do is change how my name appears in the inbox of the recipient. 

 GmailApp.sendEmail(row[RECIPIENT_COL], msgObj.subject, msgObj.text, {
         htmlBody: msgObj.html,
         bcc: 'b...@example.com',
         cc: 'c...@example.com',
         from: 'from....@example.com',
         name: 'name of the sender',
         replyTo: 're...@example.com',
        // noReply: true, // if the email should be sent from a generic no-reply email address (not available to gmail.com users)

I changed the "name: 'name of sender' 
to Johnny Matthews, however that is now preventing me from mail merging.





cwl...@gmail.com

unread,
Dec 10, 2022, 1:07:18 PM12/10/22
to Google Apps Script Community
Try this to see if it works (courtesy of https://chat.openai.com/chat)

Q: Using google apps script, how do I change how my name appears in the inbox of the recipient?

A: To change how your name appears in the inbox of the recipient when using Google Apps Script, you can use the setName method of the GmailApp class. This method allows you to specify a custom name that will be used when sending emails from your Gmail account.

Here is an example of how you can use this method in your Google Apps Script code:

// Replace "John Doe" with the name you want to use 
GmailApp.setName("John Doe");

After running this code, any emails you send from your Gmail account will use the specified name in the recipient's inbox. Note that this name will only be used for emails sent using Google Apps Script. It will not affect the name that is displayed in the recipient's inbox for emails sent using other methods (e.g., the Gmail web interface or a mobile device).

If you want to revert back to using your default Gmail name, you can use the resetName method of the GmailApp class. This method will reset the name that is used for your emails to your default Gmail name. Here is an example of how you can use this method in your Google Apps Script code:

GmailApp.resetName();

After running this code, any emails you send from your Gmail account will use your default Gmail name in the recipient's inbox.

Andrew Roberts

unread,
Dec 11, 2022, 7:18:32 AM12/11/22
to google-apps-sc...@googlegroups.com
ChatGPT is going to change the world :)

Although you've probably seen SO have banned its use!


--
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/c46e7f37-7f5b-46c2-aab1-9ae5aba032cdn%40googlegroups.com.

DimuDesigns

unread,
Dec 11, 2022, 11:09:40 AM12/11/22
to Google Apps Script Community
ChatGPT may (or may not) change the world but it certainly adds a whole new slew of ethical implications...

Still, it will be interesting to see how it all plays out.

MKBHD gives a nice overview of the topic: 

https://www.youtube.com/watch?v=0gNauGdOkro
Reply all
Reply to author
Forward
0 new messages