Frequently Asked Questions

Circular Import


I get this error:

Traceback (most recent call last):
File "..\", line 1, in <module>
    from redmail import EmailSender
File "..\redmail\", line 1, in <module>
    from .email.sender import EmailSender, send_email, gmail, outlook
File "..\redmail\email\", line 1, in <module>
    from import EmailSender
File "..\redmail\email\", line 3, in <module>
    from email.message import EmailMessage
File "..\", line 1, in <module>
    from redmail import EmailSender
ImportError: cannot import name 'EmailSender' from partially initialized module 'redmail' (most likely due to a circular import) (..\redmail\


This is due to your script is named as ´´´´ and that happens to be the same name as the email library from standard library. Please use another filename than

From in Text Body


In text body, a line starting with From gets turned to >From. For example, I have this code:

from redmail import EmailSender

email = EmailSender(...)

    subject="An example email",
    text="Hi!\nFrom what we discussed..."

But email body looks like this:

>From what we discussed...


Please use HTML body instead if this causes problems. This is a problem in smtplib itself and there is nothing to do with it at the moment. Line beginning with From is mangled to >From to avoid body injection and there is no way to switch that off. See more details from this Stackoverflow answer.