Azure-Samples / communication-services-dotnet-quickstarts

Sample code for Azure Communication Services .Net quickstarts
MIT License
75 stars 104 forks source link

No property to embed an image to email using EmailMessage with Azure Communication Service #51

Open sammym1 opened 1 year ago

sammym1 commented 1 year ago

Please provide us with the following information:

Ask is for below sample

communication-services-dotnet-quickstarts/SendEmailAdvanced/SendEmailWithAttachments/

Need to Embed an image in the mail body.

I am using EmailMessage and EmailMessage does not have "AlternateViews" property.

It's a ask and not an issue


Thanks! We'll be in touch soon.

matthohn-msft commented 1 year ago

Thank you @sammym1. Acknowledging this ask, we will be looking into this scenario more

MagnusWagner-WIT commented 1 year ago

I would also be interested in this feature.

lnehrin commented 1 year ago

So without the ability to get the CID of an attachment, how does one embed an image into the HTML of an email?? I've had zero luck trying to inline base64.

IberianTops commented 1 year ago

Same here.

Same with PowerAutomate Online, the Send Email action doesn't allow CID to work because the field Content-ID is not defined and passed through, hence you can't reference the attached images. And base64 for example is not supported by Gmail.

Weird since I believe Outlook desktop uses CID when you're sending embedded images. Yet their own automation system, that they've developed, doesn't support it.

gguillen commented 1 year ago

+1 need this

krisbart commented 1 year ago

+1

eltiano commented 1 year ago

+1

ispysoftware commented 1 year ago

this is a show stopper for us :(

EdgarsM commented 1 year ago

+1

yartman commented 1 year ago

+1 here also

Carlstorm commented 1 year ago

+1

roaddirect-development commented 1 year ago

+1

ErikRBergman commented 1 year ago

+1

zzundalek commented 1 year ago

+1

eredwan commented 1 year ago

+1 This is a bit sad that this did not come standard. I have found most of the Microsoft Azure tech that I have evaluated to be subpar at best. Many times things are missing like this. I was evaluating PowerApps and it had trouble showing all available tables for a given connection to Oracle capped at a max array of 2047 or so. It would only show tables in alphabetical order so I was missing any tables after the letter B. When contacting support they had no solution. Anyways, enough of my tangent, please add this feature to embed images to email body.

bpruissen commented 1 year ago

+1

tcrevier commented 11 months ago

I agree, I also need this functionality to use it more broadly. This doesn't seem like it would be difficult add, it is in so many other email sending APIs.

KunalAdu commented 10 months ago

At last, I've found a solution. Instead of using CID, incorporate an img tag containing base 64 content. This will insert an image in the E-mail HTML body. Inside content and html (https://github.com/Azure-Samples/communication-services-javascript-quickstarts/blob/main/send-email-advanced/send-email-attachments/send-email-attachments.js#L22)

\SomeImage

For more details, please refer to: https://learn.microsoft.com/en-us/power-automate/desktop-flows/how-to/add-images-email-messages

tcrevier commented 10 months ago

@KunalAdu Thanks! That is a reasonable work around for the short term...

jfperren commented 9 months ago

+1! Also need this

leonardogazdek commented 8 months ago

KunalAdu this will not work in gmail unfortunately.

This is a very basic feature, unacceptable that the service doesn't support it. The only real good solution seems to be to host the images yourself and use the src param to point to hosted images.

crlandwe commented 7 months ago

+1

newportg commented 7 months ago

This is needed now please

sabifa commented 6 months ago

Open for nearly 1.5 years and still no response?

freedomsuites commented 4 months ago

+1 : I cannot embed generated images targeted at some email clients (e.g. GMail) without this feature. And no, the workaround provided by @KunalAdu does not work on all email clients.

https://www.caniemail.com/features/image-base64/

sebastianblesgen commented 4 months ago

+1. CID is for us the easiest to not fall in SPAM issues with external links and base64 is not supported by all clients (gmail for instance).

I know we are talking about MS technologies here but our clients do not care what we are using and we can't force everyone to move to Microsoft Outlook.

I can see that CID is generated, but we should be able to specify it.

--=-FvCcAasQtV1ElFTlafUUlA==
Content-Type: image/svg+xml; name=logo.svg
Content-Disposition: attachment
Content-Transfer-Encoding: base64
Content-Id: <0d30f8bc-d2b1-4f29-acd6-13006700285c>

NB: I use the Java EmailAsyncClient

olcaybuyan commented 4 months ago

+1

jrdzha commented 3 months ago

+1

scayze commented 3 months ago

+1

crlandwe commented 3 months ago

Bump, as other users stated, we cannot control what email services our users decide to use. please add gmail support.

tanguy3165 commented 3 months ago

+1

aardvark79 commented 2 months ago

+1

AlexAmin commented 2 months ago

+1

kubop commented 2 months ago

+1 it baffles my mind that such basic feature is not supported after almost 2 years of making a feature request and many people actually wanting it

oliverskawronek commented 2 months ago

Came here, because ChatGPT hallucinated a contentId and disposition property 🙈

I can confirm that using base64 encoded images are not working on:

Only the web.de Android app displays the image correctly. So no, using base64 encoded image is not a work around.

jake-wickstrom commented 2 months ago

+1

haseeb0807 commented 2 months ago

Workaround can be host the images and access by their URL in src param of <img src=""/> Note - SVG images will not show up, it has to be .png

wojbron-blue commented 1 month ago

+1

gayan-d commented 1 month ago

This is a very serious limitation of azure communication services. Unbelivable that it's not supported even after two years.

podvlada commented 1 month ago

+1

mjh737 commented 1 month ago

+1

gako commented 3 weeks ago

+1

adscreen commented 1 week ago

+1