Send Emails with Blazor SSR (Static Server-Side Rendering) in .NET 8 🔥

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ต.ค. 2024

ความคิดเห็น • 17

  • @saroshwadia
    @saroshwadia 4 หลายเดือนก่อน +3

    when is the free "The .NET 8 Web Dev Jump-Start Course" going to be available? Thx

  • @deltaHawckAndersblack05444
    @deltaHawckAndersblack05444 4 หลายเดือนก่อน +2

    thanks brother, i love your help , you are an excellent developer .

  • @simonedeste2528
    @simonedeste2528 4 หลายเดือนก่อน

    Hello Patrick! Does this method for sending emails work even if I am developing an online app for a writers' website? And more importantly, can I transfer it to different projects I'm working on by simply modifying a template? (changing the logo, the email sender, etc.)

  • @TheQvisionsa
    @TheQvisionsa 4 หลายเดือนก่อน

    Great! Do you have any plan for a video regarding Blazor SSR EditForm with elements changed using js?

  • @alialshreef2874
    @alialshreef2874 4 หลายเดือนก่อน

    Thanks a lot 💯

  • @pablokoike
    @pablokoike 4 หลายเดือนก่อน

    Thanks a lot! Very usefull. :)

  • @TheLastEmperorXiXinPig
    @TheLastEmperorXiXinPig 4 หลายเดือนก่อน

    Great tutorial. But is the @code{} section running in the backend and secured, not able to be seen by the end-user in their client browsers?

    • @georgecarr7054
      @georgecarr7054 22 วันที่ผ่านมา

      It's my understanding that..The @code section is in the client project. When a blazor application is served to the client the entire client project is sent to the user.
      This project is then ran locally on their machine in the browser using web assembly (which is basically JavaScript)
      Meaning that the code section you refer too will be able accessible and therefore any secret will not be safe
      Options for this security issue are
      1.) ignore it and do it anyway. Weirdly this seems to be a common suggestion online but not something I would be comfortable with.
      2.) store the secret in the configuration file.
      I haven't looked fully into this solution however it seems that you would need to do two things to make it fully secure
      Move the send email logic done in this video to an API. Then call that API endpoint from the client to handle the sending of the email through MailKit. This will sort the issue of the user having access to it.
      Then to avoid having your SMTP username and password in the code you would have to store this on a configuration file which you then reference in the API. This means that you wont commit any passwords to GIT if your project is open source.
      Sorry for the really long reply. Will reply to this with an example project once I am done figuring it out!

    • @georgecarr7054
      @georgecarr7054 22 วันที่ผ่านมา +1

      Having looked at this more I'm incorrect! Patrick is not using Blazor WASM, he is using Blazor server

  • @pezhmanpiramoun2997
    @pezhmanpiramoun2997 4 หลายเดือนก่อน

    🤩

  • @samehgenah8067
    @samehgenah8067 4 หลายเดือนก่อน

    Great job ; what about navigation animation

  • @amirameri1354
    @amirameri1354 4 หลายเดือนก่อน

    Great 🎉. How can send html page with email ? I mean emails body incloudes style and css ?

    • @wusswuzz5818
      @wusswuzz5818 4 หลายเดือนก่อน

      string message = $"""
      Hi there!
      """;
      var body = new BodyBuilder
      {
      HtmlBody = message
      };
      email.Body = body.ToMessageBody();

  • @10Totti
    @10Totti 4 หลายเดือนก่อน

    Good Tutorial!

  • @cas818028
    @cas818028 4 หลายเดือนก่อน

    This is awesome, but I get concerned that in a team setting people could get confused of what’s running on the client and what’s running on the server since the code looks so similar. How can you guard against this? For example if this code were to accidentally ship to the client you would have exposed email smtp creds

    • @TheLastEmperorXiXinPig
      @TheLastEmperorXiXinPig 4 หลายเดือนก่อน

      Good question, I had the same issue, I asked Bing Copilot and according to it the code section is running solely on the server side and is not exposed in the client's browser. But it would be great to get confirmation from some other source on this.

    • @georgecarr7054
      @georgecarr7054 22 วันที่ผ่านมา

      @@TheLastEmperorXiXinPig I believe bing Copilot is incorrect here. Correct me if I'm wrong