How it works...

Let's take a look at the form. The save() method uses the cleaned data from the form to read the recipient's email address and the message. The sender of the email is the current user from the request.

If the email cannot be sent due to an incorrect mail server configuration or another reason, it will fail silently in this example; that is, no error will be raised. In a production site, this would probably want to be tracked somehow on the server, but we would likely still not reveal the error directly to users.

Now, let's look at the view. When the posted form is valid, the save() method of the form will be called before the user is redirected to the success page.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.97.189