SMTP、POP、IMAP
Last updated
Was this helpful?
Last updated
Was this helpful?
這三個都是郵件相關協定。
SMTP is the industry standard protocol for sending email. If you’re looking to send email, then you’ll use SMTP instead of IMAP. An can help you send email without having to build your own SMTP server.
IMAP is one of the most common protocols for receiving email. IMAP syncs messages across all devices.
POP3 is another protocol for receiving email on a single device. Using POP3 means that your email will be accessible offline and deleted from the server.
Gmail為例:
可以用Gmail 提供的服務然後搭配相關模組來傳送郵件。
如果用 Gmail 無法送信記得去設定以下
沒設定會說 credential 錯誤
2024 更新:
現在需要去 app password 產生密碼,才能放在代碼的密碼欄位,不然會出現 Username and Password not accepted
要用上方搜尋直接輸入,不然可能找不到
Gmail 為例:
可以用來讀取郵件
Gmail 為例:
因為 gmail 現在 無法插入html,所以要用開啟網站後 ctrl + c 複製,之後直接貼在mail 內文。
如果改變貼上去的大小,可以先把網頁縮小成你要的樣子(例如手機的比例)然後再複製。
如果想要大量傳送信件可以從 db query 出來後點選匯出,之後整個複製貼到 gmail 收件人上面 (用空格分隔),這樣的好處是可以一次寄 500 封,如果用程式只能一次送 100 封
記得用密件副本傳送!
user 輸入帳密後需要輸入 email,之後發送驗證碼,輸入相同驗證碼 後可登入
server 接到 user 發送 email 認證的請求後,隨機產生六個號碼存 DB
之後寄給使用者 email 這六個號碼,然後 user 在頁面上輸入六個號碼後將號碼發回 server ,如果相同及回傳 auth token 給 user,之後即可登入隨機產生六個號碼, DB 。
setup dmarc, testing using