Skip to content

Instantly share code, notes, and snippets.

@DamnedFacts
Created September 5, 2018 17:43
Show Gist options
  • Select an option

  • Save DamnedFacts/8fa5f912a49ae239f7bbebb31c42a0f7 to your computer and use it in GitHub Desktop.

Select an option

Save DamnedFacts/8fa5f912a49ae239f7bbebb31c42a0f7 to your computer and use it in GitHub Desktop.
Encode recipients, subject, and body in a 'mailto:' url
from urllib.parse import quote
def email_quote(recipients, subject, body):
recipients = quote(recipients)
subject = quote(subject)
body = quote(body)
msg = f"mailto:{recipients}?subject={subject}&body={body}"
return msg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment