title: How to send an email automatically to someone who write a new post at blog right after he create a new post
body: <p>There are quite a few youtube or instructions online but I could not find anything to apply this to blog/create. What I mean by that, I would like to have email to be sent automatically to the guy who create a new post.</p>
  <p>Here is the blog/views.py below;</p>
  <pre><code>from django.core.mail import send_mail
  
  class PostCreate(LoginRequiredMixin, CreateView):
      model = Post
      fields = [
          'title', 'content', 'head_image', 'category', 'tags'
      ]
  
      def form_valid(self, form):
          current_user = self.request.user
          if current_user.is_authenticated:
              form.instance.author = current_user
              return super(type(self), self).form_valid(form)
          else:
              return redirect('/blog/') 
  </code></pre>
  <p>I did setup settings.py like below:</p>
  <pre><code>EMAIL_HOST = 'smtp.gmail.com'
  EMAIL_PORT = 587
  EMAIL_HOST_USER = 'example@gmail.com' # my email address I put
  EMAIL_HOST_PASSWORD = '****************' # the password I put
  EMAIL_USE_TLS = True
  EMAIL_USE_SSL = False
  EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
  </code></pre>
  <p>I have a project to do right now... I don't have much time to review and study again... I am such a beginner... looking forward to having some help from here</p>