Email Attachments

I have a folder filled with pdfs, I need to email each pdf separately to a specific email address. After they are emailed, they can be moved to a separate folder.

So I would like a script that starts with the first pdf, emails it to a specific address, then moves it to another folder, then goes to the next pdf, and so forth and so on.

Any suggestions?

Thank you in advance

MailMate has would make this super-simple to automate.

Checkout this page for details on how you can use it from the command line, or look at the emate command, which seeks to make it even easier.

echo "The body of the message.” |\
emate mailto --send-now --to "Info <info@example.com>" ~/Desktop/file.txt

Then it would simply be a matter of pairing the files and the email addresses in some way that you can loop through, send them using emate and then mv them wherever you want to go when you’re done.

Not sure how this helps and scripting is beyond my means, again all I want to do is
email pdf files found in a certain folder - they need to be emailed one at a time and then either "marked" as sent or preferably moved to another folder.

The email address is the same for all files to be sent, but again, they need to be sent one at a time

Thank you for your time

Please provide:

  1. email client
  2. source folder path
  3. moved-to folder path
  4. How will email subject and body be provided?
  5. Send all emails at once, or wait for user to send and signal ready for next email/pdf?

Please read:
Tip: How Do I Get The Best Answer in the Shortest Time?

Sorry, thanks for the info

Running Keyboard Maestro 9.0.1 and OS 10.14.5

  1. email client
    using Apple Mail (or can use whatever email client is besy)

  2. source folder path
    /Users/scottsimons/Desktop/Receipts

  3. moved-to folder path
    /Users/scottsimons/Desktop/ReceiptsPosted

  4. How will email subject and body be provided?
    No need for one, or can be Static, Subject: Receipt

  5. Send all emails at once, or wait for user to send and signal ready for next email/pdf?
    Send emails as they are processed, no need for user interaction

I hope this helps,

Thank you!

Scott

@Scott_Simons, thanks for answering all my questions. That really helps clear things up.

Since you're using Apple Mail, I going to wait to see if one of the AM gurus will answer your question. If not, then I'll give it a shot (I have AM, but rarely use it.).

Meanwhile, you can review the KM Wiki to see if it will help get you started:

Those are the main elements you need. Try building the your macro using this info.

Unfortunately, way beyond my skill set - here is what I did so far, it did attach the selected attachment, although it did not send it, only attached to the email

But no looping for the next attachment to be emailed, nor moving to another folder

Any help would be greatly appreciated

Thx,

Scott


Email Receipt.kmmacros (2.8 KB)
image

You had all of the right parts, just not in the right order.
This works for me.
Your need to change the paths for the Receipts and ReceiptsPosted folders.

MACRO:   Email Receipt

**Requires: KM 8.2.4+&nbsp;&nbsp;&nbsp;macOS 10.11 (El Capitan)+**
(Macro was written & tested using KM 9.0+ on macOS 10.14.5 (Mojave))

#### DOWNLOAD Macro File:
<a class="attachment" href="/uploads/default/original/3X/f/e/febc6a18a6a2fec810ec6c5644d1d979b7c4acc3.kmmacros">Email Receipt.kmmacros</a>
**Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.**


---


<img src="/uploads/default/original/3X/0/0/0086bdebd0ace8fca8c4eeca79e1bfabb10ea9b1.png" width="549" height="996">
2 Likes

Wow! - Thank you,

I think it might have worked, looped thru all, and moved to the other folder, will find out if the web app accepts this many, if not, what do I need to insert to "pause' for 5mins - thru 1hr

thank you again