# Email with python scripting

**URL:** <https://forum.inductiveautomation.com/t/email-with-python-scripting/66726>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [November 20, 2022, 4:09pm UTC](https://forum.inductiveautomation.com/t/email-with-python-scripting/66726 "2022-11-20T16:09:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjohnson0238](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mjohnson0238](https://forum.inductiveautomation.com/u/mjohnson0238)\
**Post date:** [November 20, 2022, 4:09pm UTC](https://forum.inductiveautomation.com/t/email-with-python-scripting/66726/1 "2022-11-20T16:09:17Z")

</div>

Good day! I am looking at using the python script for email. This is what I am looking at doing:

```auto
recipients = 'matt.johnson@shawinc.com'
From = 'me'
system.net.sendEmail("mail.shawinc.com:25", "Internal_Messaging_System_Plant_81@shawinc.com", From, 0, recipients)

```

I get the error:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/a/5acd7b4b40428b72d482ad03b6e7627189d80bcb.png)

I have done this scripting before and it worked in another project using the same line of code. Any pointers for me?

---

<div class="post-metadata">

**Author:** ![code\_skin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@code\_skin](https://forum.inductiveautomation.com/u/code_skin)\
**Post date:** [November 20, 2022, 5:55pm UTC](https://forum.inductiveautomation.com/t/email-with-python-scripting/66726/2 "2022-11-20T17:55:06Z")

</div>

> [@mjohnson0238](#):
>
> `mail.shawinc.com:25`

I'd be very interested to see this working code in another project. Your arguments are out of order. Try this..

```auto
recipients = ["matt.johnson@shawinc.com"]
From = "myemail@domain.com"
system.net.sendEmail("mail.shawinc.com:25", From, "my subject", "my body text", 0, recipients)

```

---

<div class="post-metadata">

**Author:** ![mjohnson0238](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mjohnson0238](https://forum.inductiveautomation.com/u/mjohnson0238)\
**Post date:** [November 20, 2022, 10:18pm UTC](https://forum.inductiveautomation.com/t/email-with-python-scripting/66726/3 "2022-11-20T22:18:30Z")

</div>

Hey, thanks! When I was editing the items to send I got the items out of order. Thanks again!

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [November 21, 2022, 10:42pm UTC](https://forum.inductiveautomation.com/t/email-with-python-scripting/66726/4 "2022-11-21T22:42:07Z")

</div>

You should probably redact your email address... you don't want spambots finding it and sending you advertisements about enlarging your body parts or from Nigerian princes wanting to send you their inheritance. Incidentally, I've never once received the inheritance they've promised me 😕

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [November 22, 2022, 12:44pm UTC](https://forum.inductiveautomation.com/t/email-with-python-scripting/66726/5 "2022-11-22T12:44:08Z")

</div>

> [@nminchin](#):
>
> Incidentally, I've never once received the inheritance they've promised me

Should we deduce from the lack of infirmation/confirmation on this topic that the body parts did indeed get bigger ?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [November 22, 2022, 8:12pm UTC](https://forum.inductiveautomation.com/t/email-with-python-scripting/66726/6 "2022-11-22T20:12:01Z")

</div>

They did indeed! 😉 My right leg is now _twice_ the size of the left! But my doctor calls it elephantiasis 🙄\* rolls eyes \* he's just jealous
