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

  • Home
  • SEARCH
  • 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 6708887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:48:51+00:00 2026-05-26T07:48:51+00:00

I have my main.py looking like this:- #!/usr/bin/env python import cgi from google.appengine.ext import

  • 0

I have my main.py looking like this:-

#!/usr/bin/env python

import cgi
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext.webapp import util

# imports for sending mail
from google.appengine.api import mail
from google.appengine.api import users

message = mail.EmailMessage(sender="Support <xyz@gmail.com>", subject="Email from")

message.to = "info <info@xyz.com>"
message.html = """
<html><head></head><body>
Dear <b>I</b>nfo: <br /><br />
message.<br /><br />

Please let us know if you have any questions.<br /><br />

The flxlmonline.com Support Team
</body></html>
"""


class MainHandler(webapp.RequestHandler):
    def get(self):
        self.response.out.write("""
          <html>
            <body>
              <form action="/sign" method="post">
              <p>
                <label for="name">Name</label> <input type="text" name="name">
              </p>
              <p>
                <label for="email">E-mail</label> <input type="email" name="email">
              </p>
              <p>
                <label for="message">Message</label> <textarea name="message"></textarea>
              </p>
                <div><input type="submit" value="Sign Guestbook"></div>
              </form>
            </body>
          </html>""")

    def post(self):
    self.response.out.write('<html><body>You wrote:<pre>')
        self.response.out.write(cgi.escape(self.request.get('message')))
        self.response.out.write('</pre></body></html>')
    **sendMail(self.request)**

    def sendMail(request):
        message.send()


application = webapp.WSGIApplication(
                                     [('/', MainHandler),
                                      ('/sign', MainHandler)],
                                     debug=True)

def main():
    util.run_wsgi_app(application)


if __name__ == '__main__':
    main()

As you can see, I am trying to call another class method called sendEmail() from inside post. This gives compilation error. Any idea where I am going wrong?

Thanks in advance,
BTR Naidu

  • 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-26T07:48:52+00:00Added an answer on May 26, 2026 at 7:48 am

    Did you tried with?:

    def post(self):
        # ----
        self.sendMail(self.request)
    
    def sendMail(self, request):
        message.send()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an array filled with paths looking like this: library/main/single/list.php library/article/grid/thumbs.php library/footer/tiny.php These
Im looking to have a common parent function like so void main (param 1,
I have a Python 2.x module.py file that looks like this: class A(object): KEYWORD
I have a main window (#1) on my webpage from which I open a
I have a main canvas 'blackboard' in a panel, this canvas has itself several
After looking at questions like this it doesn't make sense that my __init__(self, parrent,
I am trying to produce right aligned numbers looking a bit like this: 12345
I was looking at making a folder structure like this htdocs |--app |-- myProject
This should be really simple. If I have a String like this: ../Test?/sample*.txt then
Looking for some guidance. In my main window nib file, i have a tab

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.