Ajax 非同步傳送郵件

2021-08-31 05:11:43 字數 999 閱讀 1750

很多系統中,需要實現,提交表單同時傳送郵件通知相關人員的要求.特別在類似oa系統更加常見.

而一般傳送郵件都會占用比提交表單+後台對資料處理的時間多很多.

想到兩個思路:

1.ajax非同步傳送郵件.

2.郵件資訊持久化到資料庫,資料庫定時讀取郵件資訊,傳送郵件

現在使用第一種方式:ajax非同步傳送郵件.

response.write "此bug的資訊已傳送給:"&to_fullname

response.write "bug已提交成功"

response.write "bugid="&getid

response.write "請記住此bug的id號,這會方便你的查詢和對此bug的修復!

"response.write ""

// 傳送ajax請求來達到傳送郵件之後,頁面進行跳轉[ajax無法實現]

response.redirect("add_bug_success.asp?toid="&getid)

對async配置項的理解:

default: true

by default, all requests are sent asynchronous (i.e. this is set to true by default). if you need synchronous requests, set this option to false. cross-domain requests and datatype: "jsonp" requests do not support synchronous operation. [color=red]note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active[/color].

非同步傳送郵件

using system using system.collections.generic using system.web using system.net.mail using system.text 傳送郵件類 public class smtpmail void client sendcom...

非同步傳送郵件

利用django自帶的 mail 介面傳送郵件 1 from django.core.mail import emailmultialternatives 2from threading import timer34 def send mail title,content,to list,cc li...

非同步傳送郵件 celery

包結構 依賴包 redis3.4.1 celery4.4.1 eventlet 0.25.1 首先建立乙個celery tasks的python包,在celery tasks的 init py中配置 drugstore是你專案的主目錄名稱,即有settings.py檔案的包名 這個需要改為你自己的 ...