2021年3月31日 星期三

如何在應用程式利用Google發通知郵件

1.申請1個Google的信箱。

2.使用應用程式密碼登入帳戶

使用應用程式密碼。

    1. 前往您的 Google 帳戶
    2. 選取 [安全性]。
    3. 選取「登入 Google」底下的 [應用程式密碼]。您可能需要登入。如果您沒有看到這個選項,可能原因如下:
      1. 您的帳戶並未設定兩步驟驗證。
      2. 您目前只設定使用安全金鑰進行兩步驟驗證。
      3. 您使用的是公司、學校或其他機構專用的帳戶。
      4. 您已啟用進階保護功能。
    4. 選擇底部的 [選取應用程式] 並選擇您所使用的應用程式 下一步 選擇 [選取裝置] 並選擇您所使用的裝置 下一步 選取 [產生]。
    5. 按照操作說明輸入應用程式密碼。應用程式密碼是指裝置上黃色列中的 16 位數代碼。
    6. 輕觸 [完成]。
3.參數設定參考
<configuration>
  <system.net>
    <mailSettings>
      <smtp deliveryMethod="Network" from="xxxxx@gmail.com">
        <network defaultCredentials="false" host="smtp.gmail.com" port="587" userName="xxxxx@gmail.com" password="xxxxxxxxxxxxxxxx" enableSsl="true" />
      </smtp>
    </mailSettings>
  </system.net>


沒有留言:

張貼留言

[Q&A] Send image from ionic to asp.net core (IFormFile) web api

 [Q] We are looking to upload image from ionic to .net core web api. To achieve this we are using file transfer plugin. So, far we understoo...