hi,
My view function is:
_user = request.user
sender = _user.email
contact_list =Contact.objects.all()
mailing_list = []
if request.method != 'POST':
emailform = EmailForm()
return render_to_response('email.html', locals())
if request.method == 'POST':
emailform = EmailForm(request.POST)
if emailform.is_valid():
subject = emailform.clean_data['subject']
message = emailform.clean_data['message']
send_all = emailform.clean_data['send_all']
if send_all == True:
for contacts in contact_list:
if contacts.emails.all():
for email in contacts.emails.all():
mailing_list.append(email.email)
else:
to = emailform.clean_data['to']
if not to:
error = "Select at least one mail id"
return render_to_response( 'email.html',
locals() )
else:
emailid = to.split(',' + '')
newemailid = to.split(';'+'')
for emailid in newemailid:
mailing_list.append(emailid)
try:
print sender
print mailing_list
send_mail(subject, message, sender, mailing_list)
request.user.message_set.create(message="Mail was send
successfully.")
return HttpResponseRedirect('../')
except Exception, e:
raise ValueError,e
The problem here is it its says Mail was send successfully but there
is no email in my inbox.
does any one has an idea what I am doing wrong here.
It was working fine till last week but now its not working.
I think the error is in mailing_list before it was giving me
[u'[EMAIL PROTECTED], u'[EMAIL PROTECTED] but now it give
['[EMAIL PROTECTED], [EMAIL PROTECTED]
If thats the problem how do I fix ???
Thanks
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---