Hello,
I want to realize the verification of email when sign up. But I don't
know how to send a email.
for example with a account of gmail.
I have tried the method following, but there's errors.
Could anybody help?

I create a django project, and add email configuration in settings.py.
then
    python manage.py shell
In [1]: from django.core.mail import send_mail
In [2]: send_mail('Subject', 'Body of the message.',
'from_usern...@gmail.com',['to_usern...@gmail.com'])

but...

>>> from django.core.mail import send_mail
>>> send_mail('Subject', 'Body of message.', 'mmhan...@gmail.com', ['mmhancxt@gm
ail.com'])
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "D:\Python27\lib\site-packages\django\core\mail.py", line 407,
in send_ma
il
    connection=connection).send()
  File "D:\Python27\lib\site-packages\django\core\mail.py", line 281,
in send
    return self.get_connection(fail_silently).send_messages([self])
  File "D:\Python27\lib\site-packages\django\core\mail.py", line 179,
in send_me
ssages
    new_conn_created = self.open()
  File "D:\Python27\lib\site-packages\django\core\mail.py", line 144,
in open
    local_hostname=DNS_NAME.get_fqdn())
  File "D:\Python27\lib\smtplib.py", line 239, in __init__
    (code, msg) = self.connect(host, port)
  File "D:\Python27\lib\smtplib.py", line 295, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "D:\Python27\lib\smtplib.py", line 273, in _get_socket
    return socket.create_connection((port, host), timeout)
  File "D:\Python27\lib\socket.py", line 567, in create_connection
    raise error, msg
error: [Errno 10060]
>>>

Thank you!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to