I am very sorry for your response

.
I have also found a solution in which the terminal sends me an e.mail and thanks to this (show the original) I can know my IP with only one .py file, granting permissions and putting it in to the crontab
I create the file email.py in /home/pi/ --------> Code of the file:
import smtplib, getpass, os
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
print("**** Send email with Gmail ****")
user = ('email@gmail.com')
password = ('the password of
email@gmail.com')
From = ('email@gmail.com')
password = ('password of your
email@gmail.com')
To = ('anotheremail@gmail.com')
Subject = ('Subject you want)
message = ('message you want')
gmail = smtplib.SMTP('smtp.gmail.com', 587)
gmail.starttls()
gmail.login(user, password)
gmail.set_debuglevel(1)
header = MIMEMultipart()
header ['Subject'] = Subject
header ['From'] = From
header['To'] = To
mensaje = MIMEText(mensaje, 'html') #Content-type:text/html
header.attach(Subject)
gmail.sendmail(From, to, header.as_string())
gmail.quit()
I hope it is useful to someone, it has served me.
I wanted to share it with you for helping me.
Thanks again for your answers, I'll try too. SHARING IS CARING.
