email

Attach CSV to E-Mail with MIMEBase, only attaches 'bin' document

微笑、不失礼 提交于 2021-01-29 10:47:58
问题 I want to write a function to attach a csv file to an E-Mail with HTML text. Everything works fine. I sends the E-Mail with the text and the attachment with the right information. Only the data format is wrong. I tried different varieties in MIMEBASE('application', 'octet-stream') . This one gives me a '.bin' data which I cannot open on macOS. Others gave me a plain text data which included the right data, but I don't wanna copy it manually into a csv. Does someone have a solution how I get

get current thread id in gmail using google app script

荒凉一梦 提交于 2021-01-29 10:42:05
问题 I am building a Gmail Add-On. I want to get the thread Id of current open email thread using Google Apps Script. I tried to figure out in Google Developers documentation for GmailApp . But nothing found relevant. 回答1: You can retrieve messageId of the current message from e.messageMetadata.messageId of buildAddOn(e) . Using this, you can retrieve threadId as follows. var threadId = GmailApp.getMessageById(messageId).getThread().getId(); References : getMessageById() getThread() If this was

Sending only one sheet or active sheet as pdf via email

孤者浪人 提交于 2021-01-29 10:31:06
问题 Hello I have been trying to write my first script to send just one of the sheet from one of my google document but everytime I end up sending all the sheets instead. The document has a main page daily where i have the list of emails and then 7 sheets called monday, tuesday, etc This is the code i use - can you help? function emailActivesheetAsPDF() { DocumentApp.getActiveDocument(); DriveApp.getFiles(); const ss = SpreadsheetApp.openByUrl("https://docs.google.com/spreadsheets/d/1

Send Email once Database is updated

亡梦爱人 提交于 2021-01-29 09:52:16
问题 I wondering if there is a way that for example is the LastUpdated Column in a table had not been updated for more than 10 minutes if I could use SQL mail to send an email to tell a user to check that all is still working correctly? Thanks 来源: https://stackoverflow.com/questions/63598462/send-email-once-database-is-updated

How to solve “a bytes-like object is required, not 'str'” in create_message() function?

怎甘沉沦 提交于 2021-01-29 08:34:18
问题 I'm getting an error in creating a new message using create_message(). function listed over https://developers.google.com/gmail/api/guides/drafts. def create_message(sender, to, subject, message_text): message = MIMEText(message_text) message['to'] = to message['from'] = sender message['subject'] = subject return {'raw': base64.urlsafe_b64encode(message.as_string())} Error: TypeError: a bytes-like object is required, not 'str' 回答1: base64.urlsafe_b64encode expects bytes , but the type of

HTML Email Signature CSS Not Working in Some Email Clients [duplicate]

可紊 提交于 2021-01-29 07:40:40
问题 This question already has an answer here : Wrong display of html e-mail in Outlook (1 answer) Closed 2 years ago . I'm trying to create a html based email signature with tables. It's definitely working in html, works when I copy and paste into gmail, however when I copy into Outlook, the CSS break. Did I do something wrong here? <table style="width: 500px; font-size: 12pt; font-family: Arial,sans-serif; line-height:normal;" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="width:86px;

Send HTML message with attachement (.pdf) from Shell

谁都会走 提交于 2021-01-29 07:29:56
问题 I understood how I can send a HTML message with sendmail doing: ( echo "From: me@example.com"; echo "To: you@example.com"; echo "Subject: this is my subject"; echo "Content-Type: text/html"; echo "MIME-Version: 1.0"; echo ""; echo "My <b>HTML message<\b> goes here!"; ) | sendmail -t I also manages to send an attachement with mail doing uuencode file.pdf file.pdf | mail -s "my subject" you@example.com but I fail to send an HTML message with an attachement (.pdf). Note that I failed to install

How to insert an emoji into an email sent with GmailApp?

痴心易碎 提交于 2021-01-29 06:40:58
问题 I have a GAS script that sends automated emails and would like to include a couple of emojis. I've tried using shortcodes and copying/pasting, but nothing so far seems to have worked. Just wanted to see if there was anything I was missing. Edit: Here's the code: var title = rowData.publicationTitle; var journal = rowData.journalTitle; var url = rowData.publicationUrl; //Emoji goes here in the body: var body = "Hi " + firstName + "!<br><br>I noticed your article <a href='" + url + "'>“" +

How to track an email thread programmatically

狂风中的少年 提交于 2021-01-29 05:13:43
问题 I'm working on a system that handles customer inquiries and sends emails to customers related to their inquiries. When a customer replies, I need to know which inquiry (and email thread) the email belongs to. One customer may have multiple inquiries, so I cannot tell this just based on her email address. I tried to google a bit and it seems that adding some kind of inquiry ID to the subject and the body may be a solution, but this is not 100% safe (customer can delete both). I also see that

VBA Outlook Signature Image

ⅰ亾dé卋堺 提交于 2021-01-29 04:44:57
问题 I'm trying to change outlook email signatures automatically depending on a specific keyword on the subject. On my first try I added the signature at the bottom of the email. The signature came perfect including image and all but that there was an issue with the placement as the signature was appended at the very bottom of the email below the original text. On my second try I set up a default signature that works as a placeholder. The macro then finds the placeholder and replaces it with the