Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="">
- <div>
- <input type="text" placeholder="Enter your email..." name="sender_mail">
- <textarea rows="10" cols="45" name="text_message" placeholder="Your text here..."></textarea>
- <input type="button" onclick="message.py" value="Send message">
- </div>
- </form>
- import smtplib
- import cgi
- form = cgi.FieldStorage()
- if form.getvalue("text_message"):
- mes = form.getvalue("text_message")
- if form.getvalue("sender_mail"):
- sent = form.getvalue("sender_mail")
- message = mes+" "+sent
- mail = smtplib.SMTP("smtp.mail.ru", 587)
- mail.ehlo()
- mail.starttls()
- mail.login('sender@mail.ru', 'senderspassword')
- mail.sendmail('sender@mail.ru', 'tech_support@mail.ru', message)
- mail.close()
- <script type="text/python">
- </script>
Add Comment
Please, Sign In to add comment