title: How to send an email after User post the form?
body: <p>i am beginner and used steps for sending email from <a href="https://docs.djangoproject.com/en/2.0/topics/email/" rel="nofollow noreferrer">https://docs.djangoproject.com/en/2.0/topics/email/</a> 
  but i didn't accomplished to send email. </p>
  
  <p>i want to send an email automatically using django email after a user submit the form . i am having a booking form and having email field in it after user post the form i want to send a email "Thankyou for your booking / your booking is placed ". </p>
  
  <p>for eg </p>
  
  <ol>
  <li>first name : Abubakar</li>
  <li>Last name :Afzal</li>
  <li>email : any@gmail.com</li>
  </ol>
  
  <p>i want to take any@gmail.com and send email to it . after user post the form .</p>
  
  <p><strong>settings.py</strong></p>
  
  <pre><code>EMAIL_HOST = 'smtp.gmail.com'
  EMAIL_PORT = 587
  EMAIL_HOST_USER = 'my@gmail.com'
  EMAIL_HOST_PASSWORD = 'mypassword'
  EMAIL_USE_TLS = True
  </code></pre>
  
  <p><strong>View.py</strong></p>
  
  <pre><code>     class BookingView(FormView):
           template_name = 'buggy_app/booking.html'
           form_class = BookingForm
           models = Booking
           def form_valid(self, form):
               car_id = self.request.GET.get('car', '')
               car = Car.objects.get(id=car_id)
               car.is_available_car = False
               car.save()
               form.save()
               return super(BookingView, self).form_valid(form)
          success_url = reverse_lazy('index')
  </code></pre>
  
  <p><strong>Forms.py</strong></p>
  
  <pre><code>      class BookingForm(ModelForm):
  
           class Meta:
              model = Booking
               widgets = {
               times_pick': TimePickerInput(),  }
               fields = ('first_name','last_name','email','book_car','contact_number','times_pick',)
  </code></pre>