On Mon, 2008-09-29 at 23:51 -0700, laspal wrote:
> Hi,
> I have a listing of contact from which I choose contact and get the
> mailid.
> Now I want to send mail to the selected mailid by using another form.
> 
> So right now what I am doing is :
> 
> view contacts( request):
>   if request.method == 'POST':
>         return HttpResponseRedirect(reverse('mailing_list',
> args=[string]))
> 
> and my urls are :
> (r'^contacts/$', contacts),
> 
>  url(r'^contacts/selected/(?P<mailing_list>[a-z.@, ]+)/sendmail/$',
> SendMail_Selected, name ="mailing_list"),
> 
> def SendMail_Selected(request, mailing_list):
> 
>    process the  Mailform() form here........
> 
> So my problem is right now  I am sending the mailing_list in the url.
> which is not the right way of doing it as I might have more then 100
> mail id in my url.
> 
> So I wanted to know how can I solve this problem???

Maybe you're approaching this a little backwards. Why are you wanting to
enter the "sending" function through an HTTP call? In other words, why
can't you just call it directly as a Python function and pass it the
list of mail ids you want to send?

That approach is still going to have a slight problem with scale, since
it takes a small amount of time to send each piece of mail, so
eventually the time taken will be longer than you want to wait before
returning from the view. But that's unrelated to your current and is a
standard issue when sending mail from a view (the solution is to store
the details of the mail to be sent and have some background process -- a
cronjob for example -- do the actual sending).

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to