
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
django-zoho-zeptomail
Advanced tools
ZeptoMail for Django facilitates email sending from Django applications using ZeptoMail APIs.
ZeptoMail for Django facilitates email sending from Django applications using ZeptoMail APIs.
pip install django-zoho-zeptomail
Add the following parameters in the application settings.
EMAIL_BACKEND = 'zoho_zeptomail.backend.zeptomail_backend.ZohoZeptoMailEmailBackend'
DEFAULT_FROM_EMAIL = 'rebecca@zylker.com' #The default FROM address that will be used for all emails. Optional parameter.
ZOHO_ZEPTOMAIL_API_KEY_TOKEN = 'Send Mail Token' #Send Mail Token generated from the ZeptoMail account.
ZOHO_ZEPTOMAIL_HOSTED_REGION = 'zeptomail.zoho.com' #Region where the account is hosted. Optional for US. Mandatory for other regions.
from django.core.mail import send_mail
send_mail(
subject='Hello!',
message='This is an acknowledgement for your action on our website',
from_email='rebecca@zylker.com',
recipient_list=['sam@zylker.com']
)
from django.core.mail.message import EmailMessage
email_message = EmailMessage(
subject='Hello!',
body='This is an acknowledgement for your action on our website',
from_email='rebecca@zylker.com',
to=['sam@zylker.com'],
bcc=['john@zylker.com'], # Optional
cc=['george@zylker.com'], # Optional
reply_to=['samuel@zylker.com'] # Optional
)
email_message.send()
from django.core.mail import send_mail
send_mail(
subject='Hello!',
message='This is an acknowledgement for your action on our website',
from_email='rebecca@zylker.com',
recipient_list=['sam@zylker.com'],
html_message='This is an acknowledgement for your action on our website'
)
from django.core.mail.message import EmailMultiAlternatives
email_message = EmailMultiAlternatives(
subject='Hello!',
body='This is an acknowledgement for your action on our website',
from_email='rebecca@zylker.com',
to=['sam@zylker.com'],
bcc=['john@zylker.com'], # Optional
cc=['george@zylker.com'], # Optional
reply_to=['samuel@zylker.com'] # Optional
)
email_message.attach_alternative(
'This is an acknowledgement for your action on our website',
'text/html'
)
email_message.send()
You can add attachments while using EmailMessage as well as EmailMultiAlternatives classes. This can be achieved in three ways using different methods:
from django.core.mail.message import EmailMessage
email_message = EmailMessage(
subject='Hello!',
body='This is an acknowledgement for your action on our website',
from_email='rebecca@zylker.com',
to=['sam@zylker.com']
)
email_message.attach_file('/example/attachment.txt')
email_message.attach_file('/example/attachment.jpg')
email_message.send()
from django.core.mail.message import EmailMessage
email_message = EmailMessage(
subject='Hello!',
body='This is an acknowledgement for your action on our website',
from_email='rebecca@zylker.com',
to=['sam@zylker.com']
)
# Text file (Read mode 'r')
with open('/example/attachment.txt', 'r') as file:
email_message.attach('attachment.txt', file.read())
# Binary file (Read mode 'rb')
with open('/example/attachment.jpg', 'rb') as file:
email_message.attach('attachment.jpg', file.read())
email_message.send()
from email.mime.image import MIMEImage
from email.mime.text import MIMEText
from django.core.mail.message import EmailMessage
email_message = EmailMessage(
subject='Hello!',
body='This is an acknowledgement for your action on our website',
from_email='rebecca@zylker.com',
to=['sam@zylker.com']
)
# Text file (Read mode 'r')
with open('/example/attachment.txt', 'r') as file:
mime_text = MIMEText(file.read())
mime_text.add_header(
'Content-Disposition', 'attachment; filename=attachment.txt')
email_message.attach(mime_text)
# Binary file (Read mode 'rb')
with open('/example/attachment.jpg', 'rb') as file:
mime_image = MIMEImage(file.read())
mime_image.add_header(
'Content-Disposition', 'inline; filename=attachment.jpg')
email_message.attach(mime_image)
email_message.send()
FAQs
ZeptoMail for Django facilitates email sending from Django applications using ZeptoMail APIs.
We found that django-zoho-zeptomail 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.