Mailman


#1

Mailman

Mailman is published! A minimal interop package for sending emails, task requests or creating contacts in Outlook using Dynamo.

Obviously you first need to have Outlook installed on your computer and signed in to your account in Outlook. This package is tested on Outlook 16 and Dynamo 1.3 - 2.0. However should work with previous versions of Outlook as well.


#2

#3

Tried this package this works well…! thanks for the share.
Was printing a pdf and trying a mail it to self. everything works well except that the save window appears on the screen and has to manually save the pdf before emailing it
Is there any way to get rid of the save window or any way to autosave given the file path?

Note: Thought its worth to post it here rather a new thread, sorry if it not the way to go about it.


#4

Hi @saju_autodesk

The problem you are facing is totally irrelevant to Mailman. You need to change your PDF printer settings.

Printing PDFs can be frustrating based on what virtual printer you are using.
But most of PDF printers have got some settings in the line of “prompt for file name” which you can disable. Then your PDFs will be printed and saved without the save dialog popping up.

Some of them might be trickier to set and involves changing the registry key. Have a look at this: http://archi-lab.net/printing-pdfs-from-revit-why-is-it-so-hard/ if you want to do that programmatically. However that can be done using Python as well as opposed to C# which is shown in the link. Another thing worth being aware of is that PDFs can take time to be saved. That means the file in the given path might not be available for Mailman nodes when it is looking for it. You can use this Python code to delay this process until the file becomes available:

import clr
import sys
sys.path.append(r'C:\Program Files (x86)\IronPython 2.7\Lib')

import os
from os import path

from System.Threading import Thread


pdfFilePath = IN[0]

while not path.exists(pdfFilePath):
	Thread.Sleep(500)
	
OUT = pdfFilePath

#5

@HossZamani, this is great, thanks for sharing. Is there a way to turn a list of items in Dynamo into a list of items in the email body (multi-line lists). I tried separating lists with “\r\n” and I could see it working in Dymamo but it didn’t work in the email message. Any ideas?


#7

So you have a list of strings that you want to concatenate and feed to MailBody input? Which BodyFormat are you using?


#8

That’s correct. So I would like to have the email produce a concatenated list (bulleted if possible but not absolutely necessary):

  • List item 1
  • List item 2
  • List item 3
  • Etc.

Instead it’s looking like this in the email message:

List item 1, List item 2, List item 3, Etc.
I’m using html. Thanks!


#9

Try this:

Mailbody_BulletPoint.dyn (25.7 KB)


#10

This is looking great, thanks @HossZamani!
Here’s another challenge I’m having. I’m trying to run a list of lists through your Python node and it’s not working. Ultimately my goal is to send a customized bulleted list to individual coworkers on the project. So Bill gets this list:

  • List item 1
  • List Item 2
  • List Item 3

and Sally gets this list:

  • List item 4
  • List item 5

I think I have everything else working but it’s hung up in the python node.


#11

@HossZamani, this is the problem I’m having. Can it be resolved?


#12

Sure it can!

Just remember that you need your Outlook to be open if you want to send emails to multiple addresses.

Here’s the dyn file (for some reason I can’t copy paste the Python code):
Mailbody_BulletPoint2.dyn (20.1 KB)


#13

I now get multiple emails but it seems as though there is something wrong with the bulleted list. I might be missing something but this is what my email looks like, multiple blank bullet points (there should only be 2, “Test 1” and “Test 3”).

Capture


#14

Can you share your dyn file or a screenshot. I can’t figure out anything from this, but I suspect you are not prepping your mailbody properly. Essentially what we are doing is just making an html file. See here for more about structuring html files:


#15

You’re right, it was a problem on my end. That link was very helpful (not an expert here).
I am having one small issue. Every time I open the dyn file the Action Type node doubles up the outputs (see below). I hit run and it doesn’t work. I have to replace the node before it will work. Is it a problem on my end as well?

Capture


#16

No, I’m having this problem too. Not sure what’s changed as this wasn’t happening before. I have to fix it and upload a new version of the package. For the time being see what string value actually comes out of the node in question. You can replace the node by manually typing that string value and feeding it to the Outlook._Email node.