title: Django error : smtplib.SMTPDataError
body: <pre><code>&gt;&gt;&gt; from django.core.mail import send_mail&gt;&gt;&gt; send_mail("allo", 'here is the message', 'my_email@gmail.com', ['my_email@gmail.com'], fail_silently=False)
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/home/jeremie/Desktop/email_test/myvenv/lib/python3.5/site-packages/django/core/mail/__init__.py", line 62, in send_mail
      return mail.send()
    File "/home/jeremie/Desktop/email_test/myvenv/lib/python3.5/site-packages/django/core/mail/message.py", line 348, in send
      return self.get_connection(fail_silently).send_messages([self])
    File "/home/jeremie/Desktop/email_test/myvenv/lib/python3.5/site-packages/django/core/mail/backends/smtp.py", line 111, in send_messages
      sent = self._send(message)
    File "/home/jeremie/Desktop/email_test/myvenv/lib/python3.5/site-packages/django/core/mail/backends/smtp.py", line 127, in _send
      self.connection.sendmail(from_email, recipients, message.as_bytes(linesep='\r\n'))
    File "/usr/lib/python3.5/smtplib.py", line 883, in sendmail
      raise SMTPDataError(code, resp)
  smtplib.SMTPDataError: (421, b'4.3.0 collect: Cannot write ./dfv4IKaDvq007500 (bfcommit, uid=0, gid=133): No such file or directory')
  </code></pre>
  
  <p>I did <code>export DJANGO_SETTINGS_MODULE=email_name.settings</code> in <code>bash</code> where <code>email_name</code> is the name of my django app. Because as you could see I am working with interactive python.</p>
  
  <p>I am trying to send an email, and I obtain this error. How could I fix this issue?</p>
  
  <p>Thanks!</p>
  
  <p>P.S. If the question is unclear, please let me know.</p>
  
  <hr>
  
  <p>The <code>settings.py</code> : </p>
  
  <pre><code>import os
  
  # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  
  
  # Quick-start development settings - unsuitable for production
  # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
  
  # SECURITY WARNING: keep the secret key used in production secret!
  SECRET_KEY = '*^-s1-k$lz4noyi0yhz89&amp;bmw1pz5g^pufkswal7@efva(_-fj@'
  
  # SECURITY WARNING: don't run with debug turned on in production!
  DEBUG = True
  
  ALLOWED_HOSTS = []
  
  
  # Application definition
  
  INSTALLED_APPS = [
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
  ]
  
  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',
  ]
  
  ROOT_URLCONF = 'email_name.urls'
  
  TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': [],
          'APP_DIRS': True,
          'OPTIONS': {
              'context_processors': [
                  'django.template.context_processors.debug',
                  'django.template.context_processors.request',
                  'django.contrib.auth.context_processors.auth',
                  'django.contrib.messages.context_processors.messages',
              ],
          },
      },
  ]
  
  WSGI_APPLICATION = 'email_name.wsgi.application'
  
  
  # Database
  # https://docs.djangoproject.com/en/1.11/ref/settings/#databases
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.sqlite3',
          'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
      }
  }
  
  
  # Password validation
  # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
  
  AUTH_PASSWORD_VALIDATORS = [
      {
          'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
      },
      {
          'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
      },
      {
          'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
      },
      {
          'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
      },
  ]
  
  
  # Internationalization
  # https://docs.djangoproject.com/en/1.11/topics/i18n/
  
  LANGUAGE_CODE = 'en-us'
  
  TIME_ZONE = 'UTC'
  
  USE_I18N = True
  
  USE_L10N = True
  
  USE_TZ = True
  
  
  # Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/1.11/howto/static-files/
  
  STATIC_URL = '/static/'
  </code></pre>
  
  <p>Notice that I am not looking for to create a django project, but rather test out the method send_mail(). That's why the code <code>settings.py</code> is standard.</p>