Skip to main content

An email sending utility for python

Project description

firemail

firemail is a simple Python module for sending emails using the SMTP protocol. It allows you to send plain text or HTML emails and optionally attach files. The module is designed to work with Gmail by default but can be configured for other SMTP servers as well.

Installation

To use firemail, you can install it via pip:

pip install firemail

Usage

import os
from firebmail import sendmail


# Example usage
sender = "yourmail@example.com"
password = "your_app_password"
payload = "Hello, this is a test email!"
recipient = "recipient_email@example.com"
subject = "Test Email"

sendmail(payload, recipient, sender,password, subject)

Function Parameters

The sendmail function has the following parameters:

payload: The string containing the message, either in plain text or HTML format. recipient: The email address of the recipient. sender: Your email address password: Your app password subject: The email subject (default is "Message from firemail"). type: The type of payload, either 'plain' or 'html' (default is 'plain'). filepath: The path of the email attachment, default is None. client: The name of the client (default is 'smtp.gmail.com'). Attempts to use unrelated mail services may result in failure

Example with attachment

import os
from firebmail.firebmail import sendmail



# Example usage with attachment
sender = "yourmail@example.com"
password = "your_app_password"
payload = "Hello, this email includes an attachment."
recipient = "recipient_email@example.com"
subject = "Email with Attachment"
filepath = "path/to/your/file.pdf"

sendmail(payload, recipient,sender, password, subject, filepath=filepath)

Note

Make sure to use this module responsibly and adhere to the email sending policies of your email service provider. Additionally, consider using application-specific passwords for enhanced security.

For Gmail users, you can generate an app password by following the instructions here.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Issues

If you encounter any issues, feel free to open an issue in the repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

firebmail-0.1.3.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

firebmail-0.1.3-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file firebmail-0.1.3.tar.gz.

File metadata

  • Download URL: firebmail-0.1.3.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for firebmail-0.1.3.tar.gz
Algorithm Hash digest
SHA256 cf5209d344e552f3153e77fc0a92600c8291981f0232f7a0a0d7d04bc400f74d
MD5 61a916fc7fcb106422c76aed6492a561
BLAKE2b-256 71bf851b9a26e2866fcdf4db3c884704ee260f5c6dbb5098fab394f99ce6b554

See more details on using hashes here.

File details

Details for the file firebmail-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: firebmail-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for firebmail-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fabc7bce7ef90f8a58882f04a8b5cc91e30016dc2de5b8ebc14d8c63d13f4a75
MD5 0e0710a9c4c3d702b2d42cd9d180487b
BLAKE2b-256 06f18062e43b29d107a0afcaa3d36211120b8aea8e1668c30b5045417f379385

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page