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 8115879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:36:29+00:00 2026-06-06T03:36:29+00:00

I have a web.py project with a notice module – the system will notice

  • 0

I have a web.py project with a notice module – the system will notice users by sending an email with HTML format .

I know how to send HTML format email in python .(Also desc in this Q sendmail with HTML message) , and also know the sendmail() funciton in web.py (version 0.37).

import web

web.config.smtp_server = 'smtp.gmail.com' 
web.config.smtp_port = 587                
web.config.smtp_username = 'goooooooooooooogle@gmail.com' 
web.config.smtp_password = '*********'    
web.config.smtp_starttls = True

web.sendmail('goooooooooooooogle@gmail.com',['1361877@gmail.com'],'Hello nodexy','This email is from web.py !')

I expect :

web.sendmail('goooooooooooooogle@gmail.com',['1361877@gmail.com'],'Hello nodexy', '<html><img src="hello.png"/></html>')

Now how can I fix this in web.py ? I’m sure I can not set the HTML string to the sendmail() function .

  • 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-06-06T03:36:31+00:00Added an answer on June 6, 2026 at 3:36 am

    send html mail, add a key to headers:

    web.sendmail(from_address, to_address, subject, msg, headers={'Content-Type':'text/html;charset=utf-8'})
    

    in web.py utils.py, see _EmailMessage’s prepare_message method:

    def prepare_message(self):
        for k, v in self.headers.iteritems():
            if k.lower() == "content-type":
                self.message.set_type(v)
            else:
                self.message.add_header(k, v)
    
        self.headers = {}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have web application Project having RPC call. one RPC async is working fine.
I have a web project that I am ripping out all the inline styling
I have a web project working perfecly on my web server and on my
So I have a web project, and I'm trying to get the root directory
I have a web application project that works with a quite large database (over
I have a web site project with a lot of files, it has become
I have downloaded a web project from CodePlex and am getting the following error
I have a Web setup project. In the setup I have an input field
I have a static Web project added to an Apache server. Whenever I make
I have a web application project. I am trying to find out why certain

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.