Skip to content

Commit

Permalink
add Windows email support
Browse files Browse the repository at this point in the history
  • Loading branch information
Davide Depau committed Apr 2, 2014
1 parent d33b9ac commit 2896052
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions plyer/platforms/win/email.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import os
from urllib import quote
from plyer.facades import Email

class WindowsEmail(Email):
def _send(self, **kwargs):
recipient = kwargs.get('recipient')
subject = kwargs.get('subject')
text = kwargs.get('text')
create_chooser = kwargs.get('create_chooser')

uri = "mailto:"
if recipient:
uri += str(recipient)
if subject:
uri += "?" if not "?" in uri else "&"
uri += "subject="
uri += quote(str(subject))
if text:
uri += "?" if not "?" in uri else "&"
uri += "body="
uri += quote(str(text))

os.startfile(uri)


def instance():
return WindowsEmail()

0 comments on commit 2896052

Please sign in to comment.