When I send emails for some reason I get this error: Email quota exceeded. Rerouting email to app owner instead of ‘example@example.com’. My server code is
import anvil.email
import anvil.tables as tables
import anvil.tables.query as q
from anvil.tables import app_tables
from datetime import datetime
import anvil.server
# To allow anvil.server.call() to call functions here, we mark them with @anvil.server.callable.
# Here is an example - you can replace it with your own:
#
# @anvil.server.callable
# def say_hello(name):
# print("Hello, " + name + "!")
# return 42
@anvil.server.callable
def add_feedback(name,email,feedback):
app_tables.feedback.add_row(
name=name,
email=email,
feedback=feedback,
created=datetime.now()
)
anvil.email.send(to="choprasahil.sc@gmail.com",
subject=f"Feedback from {name}",
text=f"""
A new person has filled out the feedback form!
Name: {name}
Email address: {email}
Feedback:
{feedback}
""")
I have the email and data tables services and my form code is
from anvil import *
import anvil.server
import anvil.tables as tables
import anvil.tables.query as q
from anvil.tables import app_tables
class Form1(Form1Template):
def __init__(self, **properties):
# Set Form properties and Data Bindings.
self.init_components(**properties)
# Any code you write here will run when the form opens.
def submit_button_click(self, **event_args):
"""This method is called when the button is clicked"""
name = self.name_box.text
email = self.email_box.text
feedback = self.feedback_box.text
anvil.server.call('add_feedback', name, email, feedback)
Notification("Feedback submitted!").show()
self.clear_inputs()
pass
def clear_inputs(self):
# Clear our three text boxes
self.name_box.text = ""
self.email_box.text = ""
self.feedback_box.text = ""
And an image of my design screen: