Пример #1
0
def sending(request,p):
	sent_from = request.session["user_id"]
	sent_to = request.POST.get('to')
	subj = request.POST.get('subject')
	content = request.POST.get('content')
	try:
		use = user.objects.get(user_id=sent_to)
	except user.DoesNotExist:
		return HttpResponseRedirect('../new_mail')
	if use is not None:
		m = mailing(sender=user.objects.get(user_id=sent_from),receiver=user.objects.get(user_id=sent_to),subject=subj,messege=content)
		n = sent_mai(sende=user.objects.get(user_id=sent_from),receive=user.objects.get(user_id=sent_to),subject=subj,messege=content)
		m.save()
		n.save()
		return HttpResponseRedirect('/mymail/success/'+p+'/')
Пример #2
0
def sending(request):
    sent_from = request.session["user_id"]
    sent_to = request.POST.get('to')
    subj = request.POST.get('subject')
    content = request.POST.get('content')
    try:
        use = user.objects.get(user_id=sent_to)
        print use, sent_to, sent_from, subj, content
    except user.DoesNotExist:
        return HttpResponseRedirect('../new_mail')
    if use is not None:
        m = mailing(sender=user.objects.get(user_id=sent_from).user_id,
                    receiver=user.objects.get(user_id=sent_to).user_id,
                    subject=subj,
                    messege=content)
        print m
        m.save()
        return HttpResponseRedirect('../')
Пример #3
0
def sending(request):
    sent_from = request.session["user_id"]
    sent_to = request.POST.get("to")
    subj = request.POST.get("subject")
    content = request.POST.get("content")
    try:
        use = user.objects.get(user_id=sent_to)
        print use, sent_to, sent_from, subj, content
    except user.DoesNotExist:
        return HttpResponseRedirect("../new_mail")
    if use is not None:
        m = mailing(
            sender=user.objects.get(user_id=sent_from).user_id,
            receiver=user.objects.get(user_id=sent_to).user_id,
            subject=subj,
            messege=content,
        )
        print m
        m.save()
        return HttpResponseRedirect("../")
Пример #4
0
def sending(request, p):
    sent_from = request.session["user_id"]
    sent_to = request.POST.get('to')
    subj = request.POST.get('subject')
    content = request.POST.get('content')
    try:
        use = user.objects.get(user_id=sent_to)
    except user.DoesNotExist:
        return HttpResponseRedirect('../new_mail')
    if use is not None:
        m = mailing(sender=user.objects.get(user_id=sent_from),
                    receiver=user.objects.get(user_id=sent_to),
                    subject=subj,
                    messege=content)
        n = sent_mai(sende=user.objects.get(user_id=sent_from),
                     receive=user.objects.get(user_id=sent_to),
                     subject=subj,
                     messege=content)
        m.save()
        n.save()
        return HttpResponseRedirect('/mymail/success/' + p + '/')