Django: how to redirect to mailto

I have a Django admin action called "Selected Email Items". Check some participants and click the "Go" button, and the user's mail program will open. Letters from selected participants were previously entered.

This works Django HttpResponseRedirect (uri) with uri, which is "mailto: email1, email2 .. where email addresses1, email2 ... were viewed on the server.

The only problem is that the browser redirects to a blank page and also opens the client's email program.

Is there any way to avoid this?

- Peter

+3
source share
3 answers

HttpResponseRedirect. mailto: line . <a href="mailto:email1...">Email selected members</a>

+1

, , , , .

, -, , , URL- . , ( ), , API - .

, , , HttpResponse(), <meta http-equiv="refresh" content="0; url=mailto:youremail@test.com" />. , mailto:.

, Javascript window.close(). , . Javascript .

, , mailto:, /.

, !

+1

, . RFC 2616 , re 302 :

URI "" . HEAD, URI ()

, , , () . , , URL-. URL- mailto: URL- .

0
source

Source: https://habr.com/ru/post/1770132/


All Articles