
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
A simple Python wrapper for sending SMTP emails. This package lets you configure:
Clone or download this repository.
Navigate to the project directory (where pyproject.toml
or setup.py
is located).
Install in editable/development mode:
pip install -e .
Alternatively, if you've built a wheel or tar.gz
:
pip install dist/mymailsender-0.1.0-py3-none-any.whl
Once installed, you can import it anywhere in your code:
from mymailsender import MyMailSender
from mymailsender import MyMailSender
# Example instantiation of the MyMailSender class
mymailsender = MyMailSender(
smtp_server="smtp.example.com",
port=25, # or 587 for TLS, 465 for SSL, etc.
use_tls=False, # True if you want STARTTLS
use_ssl=False, # True if using SSL on port 465
use_auth=False, # True if the server requires username/password
)
# Send a simple email
mymailsender.send_mail(
sender_email="me@example.com",
recipient_emails=["you@example.org"],
subject="Hello World",
body_text="This is a test email using mymailsender."
)
The MyMailSender
class uses a mailsender.yaml
file for default configurations. This file should be placed in the project directory and can include the following settings:
smtp_server: "smtp.example.com"
port: 25
use_tls: false
use_ssl: false
use_auth: false
username: "your_username"
password: "your_password"
You can also override these settings by providing arguments when initializing the MyMailSender
instance:
from mymailsender import MyMailSender
mymailsender = MyMailSender(
smtp_server="smtp.override.com",
port=587,
use_tls=True,
# Additional overrides as needed
)
The available configuration parameters are:
"smtp.gmail.com"
, "localhost"
, etc.25
or 587
(if use_tls=True
), or 465
(if use_ssl=True
).True
to enable STARTTLS after connecting. Typically used with port 587.True
if you want an SSL connection from the start (SMTPS). Typically used with port 465.True
if the server requires authentication with username and password.use_auth=True
).use_auth=True
).from mymailsender import MyMailSender
# Create the MyMailSender
mymail = MyMailSender(
smtp_server="localhost",
port=25,
use_tls=False,
use_ssl=False,
use_auth=False
)
# Send a basic text-only message
mymail.send_mail(
sender_email="sender@localhost",
recipient_emails=["recipient@localhost"],
subject="Test Email",
body_text="Hello from mymailsender!",
)
from mymailsender import MyMailSender
mymail = MyMailSender(
smtp_server="smtp.example.com",
port=587,
use_tls=True,
use_ssl=False,
use_auth=True,
username="myuser",
password="mypassword"
)
mymail.send_mail(
sender_email="myuser@example.com",
recipient_emails=["recipient@example.org"],
subject="Hello with Attachments",
body_text="Hello, please see the attached files.",
attachments=[
"reports/report1.pdf",
"/path/to/image.png"
]
)
Configure some custom connection settings in mailsender.yaml
:
smtp_server: "smtp.example.com"
username: myusername
password: mypass
Which now allows you to initialize the MyMailSender
instance without specifying any arguments:
from mymailsender import MyMailSender
mymail = MyMailSender()
mymail.send_mail(
sender_email="me@example.com",
recipient_emails=["primary@example.org"],
subject="Test CC and BCC",
body_text="Hello, just testing CC and BCC!",
cc_emails=["colleague@example.org"],
bcc_emails=["secret@example.org"]
)
This project is distributed under the MIT License. Feel free to use it, modify it, or distribute it as you wish. See LICENSE for more information.
FAQs
A simple Python mailer for SMTP sending.
We found that mymailsender demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.