Mailto Text Tag
-
- Newbie
- Posts: 9
- Joined: Sat Jun 30, 2018 7:58 am
- Contact:
Mailto Text Tag
There is a mailto tag in renpy? I'm thinking about using this feature to send anonymal data about game crashes and exceptions to my mail. (Notifying the player first, of course). Mmm... Maybe using the Python mail module or something. What do you think?
- xavimat
- Eileen-Class Veteran
- Posts: 1461
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
- Discord: xavimat
- Contact:
Re: Mailto Text Tag
I think it's a bad idea.
Thanks to your question, I've learned how to send emails inside renpy. It's pretty funny, actually. BUT I've put my gmail user and password in the code to do it. It's easy to unrpyc renpy files, so the password will be visible. Bad idea.
I suggest you another way, with web requests. See these threads:
viewtopic.php?f=8&t=49358&p=484662&hilit=mail#p484662
viewtopic.php?f=8&t=47568
I show here the insecure code, as an exercise, not intended for actual games that got distributed.
1. Added an Action SendMail
2. Added a button in the screen that shows the traceback.txt file.
3. Copied manually two python modules that renpy does not have: hmac.py and smtplib.py.
ATTENTION: Insecure code. Do not use in distributed games:
Thanks to your question, I've learned how to send emails inside renpy. It's pretty funny, actually. BUT I've put my gmail user and password in the code to do it. It's easy to unrpyc renpy files, so the password will be visible. Bad idea.
I suggest you another way, with web requests. See these threads:
viewtopic.php?f=8&t=49358&p=484662&hilit=mail#p484662
viewtopic.php?f=8&t=47568
I show here the insecure code, as an exercise, not intended for actual games that got distributed.
1. Added an Action SendMail
2. Added a button in the screen that shows the traceback.txt file.
3. Copied manually two python modules that renpy does not have: hmac.py and smtplib.py.
ATTENTION: Insecure code. Do not use in distributed games:
Code: Select all
label start:
$ a = 3 / 0 # Division by zero error
return
screen _exception_actions(traceback_fn, tt, *args):
textbutton _("Open"):
action _EditFile(traceback_fn)
hovered tt.action(_("Opens the traceback.txt file in a text editor."))
textbutton _("Copy"):
action _CopyFile(traceback_fn)
hovered tt.action(_("Copies the traceback.txt file to the clipboard."))
textbutton _("Send"):
action SendEmail(traceback_fn)
hovered tt.action(_("Sends the traceback.txt file to the developer."))
init python:
import smtplib
class SendEmail(Action):
def __init__(self, filename):
self.filename = filename
def __call__(self):
with open(self.filename, "rb") as f:
f.read(3) # skip the BOM.
s = u"{}".format(f.read().decode("utf-8"))
s = s.replace("\n", "\r\n")
s = s.replace("\r\r", "\r")
server = smtplib.SMTP('smtp.gmail.com', 587)
server.starttls()
# INSECURE CODE HERE!!!!:
server.login("MYGMAILUSER", "MYGMAILPASSWORD")
server.sendmail("MYGMAILUSER@gmail.com", "RECIPIENT@EMAIL.COM", s)
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Mailto Text Tag
I don't recommend this. Write a web service, and have that send email. If you can't do that, you have no business doing this.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Mailto Text Tag
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
-
- Newbie
- Posts: 9
- Joined: Sat Jun 30, 2018 7:58 am
- Contact:
Re: Mailto Text Tag
It hurts.
Who is online
Users browsing this forum: No registered users