# Sending email with .ics attachment

**URL:** <https://forum.inductiveautomation.com/t/sending-email-with-ics-attachment/57875>\
**Category:** Ignition\
**Created:** [March 31, 2022, 2:49pm UTC](https://forum.inductiveautomation.com/t/sending-email-with-ics-attachment/57875 "2022-03-31T14:49:13Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Corentin.appart](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@Corentin.appart](https://forum.inductiveautomation.com/u/Corentin.appart)\
**Post date:** [March 31, 2022, 2:49pm UTC](https://forum.inductiveautomation.com/t/sending-email-with-ics-attachment/57875/1 "2022-03-31T14:49:13Z")

</div>

Hello everybody,

I want to send an Email with an attachment with “.ics” extension.  
However, i have this error message

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/e/fe909a2b6d580fddf705c878ff1f7d2dfdd7680d.png)

Any solutions ?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@peter](https://forum.inductiveautomation.com/u/peter)\
**Post date:** [March 31, 2022, 2:55pm UTC](https://forum.inductiveautomation.com/t/sending-email-with-ics-attachment/57875/2 "2022-03-31T14:55:22Z")

</div>

It might help to show how you are sending the email, and how you are attaching the ics file

---

<div class="post-metadata">

**Author:** ![Corentin.appart](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@Corentin.appart](https://forum.inductiveautomation.com/u/Corentin.appart)\
**Post date:** [April 1, 2022, 6:20am UTC](https://forum.inductiveautomation.com/t/sending-email-with-ics-attachment/57875/3 "2022-04-01T06:20:21Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/b/7bd79185495ccff07c8b7c5ccd8e0aa540f801e2.png)

as you can see, i have a .txt file that i want to convert in .ics file.

I am able to send the email when i switch to “templateics.txt”

---

<div class="post-metadata">

**Author:** ![peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@peter](https://forum.inductiveautomation.com/u/peter)\
**Post date:** [April 1, 2022, 1:14pm UTC](https://forum.inductiveautomation.com/t/sending-email-with-ics-attachment/57875/4 "2022-04-01T13:14:47Z")

</div>

The other question I forgot to ask was, what version of Ignition, and where are you sending it from (vision? perspective?) ?

I assume that you see the actual file in the label. And from you comment, do you mean that when you change

`["templates.ics"]` to `["templateics.txt"]`

In the sendEmail call, That you can send the file?

---

<div class="post-metadata">

**Author:** ![Corentin.appart](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@Corentin.appart](https://forum.inductiveautomation.com/u/Corentin.appart)\
**Post date:** [April 1, 2022, 1:28pm UTC](https://forum.inductiveautomation.com/t/sending-email-with-ics-attachment/57875/5 "2022-04-01T13:28:47Z")

</div>

sorry …

I am using ignition 8.1.14 and i am sending it from perspective.

that’s it, when i give “templateics.txt” as Filename argument i receive the email correctly with the attachment.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [April 1, 2022, 1:31pm UTC](https://forum.inductiveautomation.com/t/sending-email-with-ics-attachment/57875/6 "2022-04-01T13:31:15Z")

</div>

Hmm. I think `.ics` files may not have an associated MIME type by default… this may be something that requires a feature or bug fix.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 1, 2022, 1:36pm UTC](https://forum.inductiveautomation.com/t/sending-email-with-ics-attachment/57875/7 "2022-04-01T13:36:30Z")

</div>

A way to explicitly set mime types for each attachment would be ideal…

---

<div class="post-metadata">

**Author:** ![peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@peter](https://forum.inductiveautomation.com/u/peter)\
**Post date:** [April 1, 2022, 1:46pm UTC](https://forum.inductiveautomation.com/t/sending-email-with-ics-attachment/57875/8 "2022-04-01T13:46:41Z")

</div>

If there is no explicit mime type associated with a file type (in this case an ics file), why doesn’t the system default to a sensible mime type of something like “octet-stream”?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [April 1, 2022, 1:49pm UTC](https://forum.inductiveautomation.com/t/sending-email-with-ics-attachment/57875/9 "2022-04-01T13:49:54Z")

</div>

It probably should have done something like that, but this is some of the oldest code in Ignition and it doesn’t. I don’t know if this case has never been tested or if it used to work but now doesn’t as the result of some change in the last 10-15 years.

I opened a ticket for this either way.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 1, 2022, 1:51pm UTC](https://forum.inductiveautomation.com/t/sending-email-with-ics-attachment/57875/10 "2022-04-01T13:51:17Z")

</div>

> [@peter](#):
>
> a sensible mime type

Mwah-ha-ha!! You dreamer, you.

---

<div class="post-metadata">

**Author:** ![peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@peter](https://forum.inductiveautomation.com/u/peter)\
**Post date:** [April 1, 2022, 1:58pm UTC](https://forum.inductiveautomation.com/t/sending-email-with-ics-attachment/57875/11 "2022-04-01T13:58:08Z")

</div>

Would there be a way to to bypass sendEmail, and construct and send the email as raw data? I’ve seen references online to the Python smtplib module, but I have no idea if this is available under Jython, or an equivalent under Java?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 1, 2022, 2:06pm UTC](https://forum.inductiveautomation.com/t/sending-email-with-ics-attachment/57875/12 "2022-04-01T14:06:25Z")

</div>

Probably need to start here:

[https://javaee.github.io/javamail/docs/api/](https://javaee.github.io/javamail/docs/api/)

---

<div class="post-metadata">

**Author:** ![peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@peter](https://forum.inductiveautomation.com/u/peter)\
**Post date:** [April 1, 2022, 2:11pm UTC](https://forum.inductiveautomation.com/t/sending-email-with-ics-attachment/57875/13 "2022-04-01T14:11:45Z")

</div>

One downside is that the Ignition sendEmail automatically routes the email via the GW so that the client doesn’t need direct SMTP access to the mail server. I guess that you could achieve this by creating a GW script that handled the email sending and calling that from the client.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 1, 2022, 2:12pm UTC](https://forum.inductiveautomation.com/t/sending-email-with-ics-attachment/57875/14 "2022-04-01T14:12:43Z")

</div>

> [@peter](#):
>
> I guess that you could achieve this by creating a GW script that handled the email sending and calling that from the client.

I considered that a given. (:
