Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

msgraph-email

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

msgraph-email

Read/Send emails using Microsoft Graph API

  • 1.2.0
  • PyPI
  • Socket score

Maintainers
1

msgraph-email

Microsoft Graph Email API using Python License PyPI - Downloads PayPal Donate

Installation

msgraph-email is available on PyPI.

    pip install msgraph-email

Import modules

from mail.msgraph import EmailService
from mail.models import EmailMessage,EmailAttachment

Configure an Email Service


emailService = EmailService(tenant_id, client_id, client_secret, email_address)

Process to read an email request

By default it will read unread emails of the 'Inbox' mailfolder

emailMessages= emailService.readEmails() 

Process to send an email request

emailMessage = EmailMessage()
emailMessage.toEmails="test@mail.com"
emailMessage.message="Hello"
emailService.sendEmail(message)

Process to read and unread an email request

emailMessages = emailService.readEmails()
for email in emailMessages:
    #mark it read
    emailService.markEmailReadUnRead(email.messageId,isRead=True)
    #mark it unread
    #emailService.markEmailReadUnRead(email.messageId,isRead=False)

Make a delete email request

emailMessages = emailService.readEmails()
for email in emailMessages:
    emailService.deleteEmail(email.messageId)

FAQs


Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc