{"id":24514,"library":"redmail","title":"Red Mail","description":"Red Mail is a modern email sending library for Python that allows sending emails with attachments, embedded images, Jinja templating, and support for multiple email protocols (SMTP, Outlook, Gmail, etc.). The current version is 0.6.0, with an active release cadence. It requires Python >=3.6.","status":"active","version":"0.6.0","language":"python","source_language":"en","source_url":"https://github.com/Miksus/red-mail","tags":["email","smtp","outlook","gmail","jinja","attachments"],"install":[{"cmd":"pip install redmail","lang":"bash","label":"Install via pip"},{"cmd":"pip install redmail[pandas]","lang":"bash","label":"Install with pandas support"}],"dependencies":[{"reason":"Required for Jinja templating; included automatically.","package":"jinja2","optional":true},{"reason":"Optional for table prettifying with DataFrames.","package":"pandas","optional":true}],"imports":[{"note":"Main class for sending emails.","symbol":"EmailSender","correct":"from redmail import EmailSender"},{"note":"GmailSender is directly from redmail, not a submodule.","wrong":"from redmail.gmail import GmailSender","symbol":"GmailSender","correct":"from redmail import GmailSender"},{"note":"OutlookSender is directly from redmail, not a submodule.","wrong":"from redmail.outlook import OutlookSender","symbol":"OutlookSender","correct":"from redmail import OutlookSender"}],"quickstart":{"code":"from redmail import EmailSender\n\nemail = EmailSender(\n    host=\"smtp.example.com\",\n    port=587,\n    username=\"user@example.com\",\n    password=\"secret\",\n    use_startls=True\n)\nemail.send(\n    subject=\"Example\",\n    receivers=[\"recipient@example.com\"],\n    text=\"Hello!\",\n    html=\"<h1>Hello!</h1>\"\n)","lang":"python","description":"Basic usage: create an EmailSender with SMTP credentials and send a simple email."},"warnings":[{"fix":"Use `username=...` instead of `user_name=...`.","message":"The `user_name` parameter was renamed to `username` in v0.4.0. Using `user_name` will raise an error.","severity":"gotcha","affected_versions":">=0.4.0"},{"fix":"No immediate change, but avoid hardcoding credentials.","message":"The `password` parameter is still accepted but its use is deprecated; use `password` is fine, but consider using environment variables or a secrets manager.","severity":"deprecated","affected_versions":">=0.5.0"},{"fix":"Always provide both `text` and `html` unless you intend plain text only.","message":"When using `send` with `text` and `html` arguments, the email structure might be multipart/alternative. If you don't set a text body, some clients may not display HTML properly.","severity":"gotcha","affected_versions":"all"},{"fix":"Refer to docs: pass image as `attachments` with `content_id`.","message":"Embedded images require a valid Content-ID; if the image is not embedded correctly, it may not display. Use `embed_image` parameter with image path or bytes.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use `username='your@email.com'` instead of `user_name='...'`.","cause":"The parameter `user_name` was renamed to `username` in v0.4.0.","error":"AttributeError: 'EmailSender' object has no attribute 'user_name'"},{"fix":"Install pandas with `pip install pandas` or install redmail with extras: `pip install redmail[pandas]`.","cause":"Tried to use pandas-related features (like table prettifying) without having pandas installed.","error":"ModuleNotFoundError: No module named 'pandas'"},{"fix":"Check username/password, enable less secure app access or use an app password.","cause":"Incorrect email credentials or less secure app access not enabled (for Gmail).","error":"smtplib.SMTPAuthenticationError: (535, b'5.7.8 Username and Password not accepted')"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}