I have noticed you need to define all the email options in your
settings file for send_mail to work. I took me quite a while to find
out why my app wasnt sending emails out.
add this to your settings file with your details.

EMAIL_HOST = 'host.dns'
EMAIL_HOST_USER = 'XYZ'
EMAIL_HOST_PASSWORD = 'FOO'
EMAIL_PORT = 25

by the looks of it if you are not running your email server on the
localhost you need to specfy all of these, not sure if this is a bug
or not as Port should be default, but sendmail didnt work for me till
i put all the info in.

check that your smtp server lets you relay..

o

On Jun 14, 1:35 pm, Brij <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am using the django.core.mail for sending mail to users in my
> application...I have defined EMAIL_HOST but havenot defined EMAIL_PORT
> because my smtp server doesnt require a port number...
>
> Following is the view function im using :::
>
> def send_email(request, sender, reciepient):
>     subject = 'Test Mail from OST'
>     message = 'Testing email from OST'
>     from_email = '[EMAIL PROTECTED]'
>     if subject and message and from_email:
>        try:
>            send_mail(subject, message, from_email,
> ['[EMAIL PROTECTED]'])
>        except BadHeaderError:
>            return render_to_response('Error.html', {
>                 'reason': 'Objective Successfully
> Assigned...<br><br><font color=red>Problem Sending Email to the user</
> font>',
>            })
>        return render_to_response('success.html', {
>             'reason': 'Objective Successfully Assigned...<br><br>Email
> Successfully Send to the user.<br><br>'
>      })
>     else:
>         # In reality we'd use a manipulator
>         # to get proper validation errors.
>         return HttpResponse('Make sure all fields are entered and
> valid.')
>
> The error which i m getting is :::
> Exception Value: (10054, 'Connection reset by peer')
> Exception Location: C:\Python24\Lib\socket.py in readline, line 340
>
> Please guide me as to how should i go about this problem.


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

Reply via email to