Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7440347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:50:18+00:00 2026-05-29T10:50:18+00:00

I have a test.html file that I want to send via email(I am refering

  • 0

I have a test.html file that I want to send via email(I am refering about the page content). Is there a way for getting the information from the html and sending it as a email? If you have any other ideas please share.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:50:19+00:00Added an answer on May 29, 2026 at 10:50 am

    Here’s a quick and dirty script I just wrote which might be what you’re looking for.

    https://gist.github.com/1790847

    """
    this is a quick and dirty script to send HTML email - emphasis on dirty :)
    python emailpage.py http://www.sente.cc
    made to answer: http://stackoverflow.com/questions/9226719/sending-a-html-file-via-python
    Stuart Powers
    """
    import lxml.html
    import smtplib
    import sys
    import os
    
    
    page = sys.argv[1]  #the webpage to send
    
    root = lxml.html.parse(page).getroot()
    root.make_links_absolute()
    
    content = lxml.html.tostring(root)
    
    message = """From: Stuart Powers <stuart.powers@gmail.com>
    To: Stuart Powers <stuart.powers@gmail.com>
    MIME-Version: 1.0
    Content-type: text/html
    Subject: %s
    
    %s""" %(page, content)
    
    
    smtpserver = smtplib.SMTP("smtp.gmail.com",587)
    smtpserver.starttls()
    smtpserver.login("stuart.powers@gmail.com",os.environ["GPASS"])
    smtpserver.sendmail('stuart.powers@gmail.com', ['stuart.powers@gmail.com'], message)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have a test.html file with some example content: <table> <tr> <td>'Test'</td>
Say i have a file test.html that uses javascript cookies. (a) When i access
I have an html file that I want to dynamically edit before displaying to
I have these (sample) lines in a HTML-file: test.ABC.test test.ABCD.test test.ABCE.test And this Ant
I have made a html file, but when I upload and test it, I
I have the following in a html.erb file: <%= @location_list = [['test',2]] %> <script
I have an ant build file that contains JUnit test suite that I would
I have a problem. I want to send 3-4 variables from a PHP File
I have an HTML file which I want to load in a QWebView .
I want to create the search page that search the history of log file.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.