How do I compose a Gmail message with an attachment from a URL? - ruby

I am writing a little script in Ruby that searches for a file in a directory and creates a new Gmail message to send. It should have the name of the file in the subject field, and the file as an attachment.
I have this URL http://pastie.org/3240209 which gets me to the compose page of Gmail, and fills the subject with the name of a PDF file.
I want to add this file as an attachment. Can I do that somehow through the URL?

If you have to send something with gmail, you should not be doing it that way. Google exposes gmail through standard IMAP and SMTP. You can use oauth to connect to these services in ruby. See http://code.google.com/apis/gmail/oauth/. You can use oauth along with the ruby standard SMTP library to send gmail then.

Related

Ruby IMAP library: How can I upload .eml files to an imap server again?

In this thread, I got help with a script to catch all of my emails in their respective folders together with the attachments via the modules net/imap and the gem email.
I had to change my provider. So now I have the problem of choosing a new email provider and re-upload my emails to that account.
Can you kindly give me advice how to do this with these (or further) modules? Meanwhile, I look through the documentations again myself. I don't want to be spoon fed, it's just that I am not knowledgable with the IMAP RFCs right now, but need the access right now.
If I read a file mail = Mail.read('path/to/file.eml'), how would I upload every attribute from the .eml file and how would I upload the attachments saved in the same file?

Can we send file as an attachment along with message in teams programmatically?

Can we send file as an attachment along with message in teams using webhooks or api?
Currently we can send only text message using webhooks and not attach files.
I want to mimic the action in the screenshot below:-
Attach file present in the system
There are ways to first upload file to one drive and then send its link in the teams message but I do not want to use that solution.
Is there a way to directly upload file from your system as an attachment to the microsoft teams using webhook or any alternative way.
Thanks!!
Currently it is not supported to send attachments using webhook. You will need to use bot to send and receive attachments. You can refer this link.
https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/bots-filesv4

Is there an API to get e-mail smtp information (for GMail)

I want to send an e-mail using gmail API.
I want to know if the email was received successfully. And if not, what the problem. (Such as SMTP Log)
I can use Google Admin G-Suite if need.
How can I do it?
Thank you.
What you are looking for is Request read receipt after an email is sent. This would notify the sender when the recipient reads the email.
This is not something that is currently available in the gmail api. you may want to consider submitting a feature request here

How to send email with Mailgun to Gmail with content

I'm using Mailgun to send email through SMTP.
It is working perfectly except that if I send two email with different content, Gmail stacks then in a list and the second one has no content. I don't understand why. In my Mailgun log it shows it was sent with content.
Should I change the subject?

Can you send rich text messages via Twilio?

I am trying to send a rich text message via Twilio. I am able to send regular SMS messages, but I want to include a hyperlink in the body of the text.
I tried the twilio mediaUrl to include an rtf file, but that didn't work. Including html in the body of a message doesn't work as it just sends in plain text.
I'm posting via curl to the twilio endpoints, so i'd prefer not to have to get into PHP or some other language to achieve this. I just want to send raw data to twilio and receive a rich text message back, if it's possible.
Twilio developer evangelist here.
Using Twilio you can send MMS messages to numbers in the US and Canada. When you pass a mediaUrl the file needs to be hosted somewhere publicly on the web and it will then be included within the message.
You can pass files of any of the mime types listed here, though when sending RTF the result will depend on how well the receiving device supports RTF files.
If you want to include a link, I'd recommend shortening the URL (using bit.ly or similar) and just sending it as part of the text. Most smart phones will auto link the URL. Built in SMS apps on phones don't support markup of any sort, which is why your attempt with HTML just showed the raw markup.
Let me know if this helps at all.

Resources