# Section 9 sending emails

**URL:** https://forum.codewithmosh.com/t/section-9-sending-emails/18253
**Category:** Uncategorized
**Created:** [February 15, 2023, 6:39pm UTC](https://forum.codewithmosh.com/t/section-9-sending-emails/18253 "2023-02-15T18:39:35Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Python\_23](https://avatars.discourse-cdn.com/v4/letter/p/85f322/32.png) [@Python\_23](https://forum.codewithmosh.com/u/Python_23)
#### Post date: [February 15, 2023, 6:39pm UTC](https://forum.codewithmosh.com/t/section-9-sending-emails/18253/1 "2023-02-15T18:39:35Z")

</div>

I am new to Python and the code for sending email does not work for me. It gave me a bunch of red error. Does anybody know why? and have the right code for it?  
Thank you

---

<div class="post-metadata">

### Author: ![AzharUddinSheikh](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/azharuddinsheikh/32/5561_2.png) [@AzharUddinSheikh](https://forum.codewithmosh.com/u/AzharUddinSheikh)
#### Post date: [February 16, 2023, 9:04am UTC](https://forum.codewithmosh.com/t/section-9-sending-emails/18253/2 "2023-02-16T09:04:55Z")

</div>

you might get helped here

> [@Sending emails in python](https://forum.codewithmosh.com/t/sending-emails-in-python/13701):
>
> Hi All, I have written the following python program for sending email. The code is same as was explained in the course video but it is not working as expected and throwing errors. Please see what corrections are required in this script. ################################################### from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import smtplib message = MIMEMultipart() message[“from”] = “Mosh Hamedani” message[“to”] = “[mohammed.ferozkhan@gamil.…](mailto:mohammed.ferozkhan@gamil.com)

> [@Lesson 14 email](https://forum.codewithmosh.com/t/lesson-14-email/9983):
>
> I am getting this error message when I try and send email with the lesson 14 example. Any ideas why? Im Python 3.7 with Pycharm CE No module named ‘email.mime’; ‘email’ is not a package. This is the example in the lesson: from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import smtplib

> [@Lesson 14 email error - need help](https://forum.codewithmosh.com/t/lesson-14-email-error-need-help/14617):
>
> Hi Everyone, anyone can assist me who has similar issue here with setting up the email with the code below where all steps are taken correctly: Sending email from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import smtplib #import smtp message = MIMEMultipart() message[“from”] = “Jason ma” message[“to”] = “[raidenjason99@gmail.com](mailto:raidenjason99@gmail.com)” message[“subject”] = “This is a test” message.attach(MIMEText(“Body”)) with smtplib.SMTP(host=“[smtp.gmail.com](http://smtp.gmail.com)”, port=587) …
