Attach image variable into mail Attachments

Hi,

It is known that if you use the screenCapture activity you can create a screenshot and it gives you an imageVariable as output.

Then you have to use the saveImage activity to put the variable in .png format into a tangible path.

And at the end you take that path to attach the image into a sendMail activity.

BUT!

It could be possible to take the imageVariable of the screenshot and used it into the attachments properties of the sendMail activity without the need of save image into a file path?

Best Regards.

Hi,

It might be possible if we write code for sending email without using SendMail activity such as SendOutlookMailMessage, SendEmail etc. However, as SendMail activity assumes input argument for attachment is file path string, it’s difficult, I think.

image

Regards,

1 Like

No, it isn’t. A path is a string variable. An image variable is an image variable.

Yeah it sounds difficult indeed, but there is also the mailMessage variable, where you can insert every property before sending the mail in just one variable. That was what makes me thing that maybe there is a way to do it. But right now i don’t know how.

HI,

You probably means Forward-MailMessage property, right? This property seems just for identifying mail to be forwarded in mailbox. (At least, in O365 activities package.)
Or it might be possible it using SendSMTPMailMessage activity.
Anyway, the following topic might help you. Can you check this? (In your case, consider to use MemoeryStream instead of filepath)

Regards,

I was thinking that, maybe, if there is a way to transform the image variable to a fisical file identifying the path and format of the file you want to generate, it should be a way to pass the image variable without creating this fisical file.

Maybe is to much for 2022 generation :sweat_smile: