Unable to send email

Environment:

Request Method: POST
Request URL: http://127.0.0.1:8000/accounts/register/

Django Version: 4.2
Python Version: 3.11.2
Installed Applications:

['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'category',
 'accounts',
 'store',
 'carts']

Installed Middleware:

['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']
Traceback (most recent call last):
  File "C:\Users\samsung\AppData\Local\Programs\Python\Python311-32\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\samsung\AppData\Local\Programs\Python\Python311-32\Lib\site-packages\django\core\handlers\base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\samsung\Desktop\Rangi\accounts\views.py", line 42, in register
    send_email.send()
    ^^^^^^^^^^^^^^^^^
  File "C:\Users\samsung\AppData\Local\Programs\Python\Python311-32\Lib\site-packages\django\core\mail\message.py", line 298, in send
    return self.get_connection(fail_silently).send_messages([self])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\samsung\AppData\Local\Programs\Python\Python311-32\Lib\site-packages\django\core\mail\backends\smtp.py", line 127, in send_messages
    new_conn_created = self.open()
                       ^^^^^^^^^^^
  File "C:\Users\samsung\AppData\Local\Programs\Python\Python311-32\Lib\site-packages\django\core\mail\backends\smtp.py", line 85, in open
    self.connection = self.connection_class(
                      
  File "C:\Users\samsung\AppData\Local\Programs\Python\Python311-32\Lib\smtplib.py", line 255, in __init__
    (code, msg) = self.connect(host, port)
                  ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\samsung\AppData\Local\Programs\Python\Python311-32\Lib\smtplib.py", line 341, in connect
    self.sock = self._get_socket(host, port, self.timeout)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\samsung\AppData\Local\Programs\Python\Python311-32\Lib\smtplib.py", line 312, in _get_socket
    return socket.create_connection((host, port), timeout,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\samsung\AppData\Local\Programs\Python\Python311-32\Lib\socket.py", line 827, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\samsung\AppData\Local\Programs\Python\Python311-32\Lib\socket.py", line 962, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Exception Type: gaierror at /accounts/register/
Exception Value: [Errno 11001] getaddrinfo failed

Note 1: When posting code, errors, templates, traceback message, etc here, enclose the text between lines of three backtick - ` characters. This means you’ll have a line of ```, then the code (or whatever), then another line of ```. This forces the forum software to keep your code properly formatted. (I’ve taken the liberty of editing your original post to fix this.)

Note 2: When posting an issue, please do not use generic titles that don’t describe the issue. Again, I’ve fixed this one for you.

Please post your view that is causing this error, along with the email-related settings from your settings.py file. (Remember to blank out the password.)

I think the problem is in the method: send_mail.send() in my views.py file, and I can’t find my error