C
C#

help

Sending email SMTP[Answered]

OObel9/29/2022
I am trying to send an email using SMTP. The backend works, and i can send emails via Swagger. But i just cannot make it work from the Blazor FrontEnd I get the MimeKit No address found exception as seen in the snippet. I have a service on the client that refers to the controller and service on server side. Gonna attach snippets of relevant classes Thanks for the help in advance! 🙂
AAnchy9/29/2022
Set a breakpoint and see what the value of request.To is
UUUnknown User9/29/2022
2 Messages Not Public
Sign In & Join Server To View
OObel9/29/2022
Yes, it just seems that the ''To'' email is not recognized by MimeKit, and im not sure why
AAnchy9/29/2022
That specific error shows up when the startIndex and endIndex is equal in the parser so my guess is your To is an empty string or something if I read the parser correctly
OObel9/29/2022
Yes, the issue is definitely, that the frontend input is not processed to the backend. I've been trying a few things to fix it, but i just cant figure it out. Maybe i'll look into SendGrid
AAnchy9/29/2022
Try use [FromBody] instead of [FromForm] because I see you are posting using json and I think the attributes handle the information differently?
OObel9/29/2022
But as you can see, it does take the input
AAnchy9/29/2022
I'm not an asp.net user so I'm kind of stabbing in the dark
OObel9/29/2022
Oh true, [FromForm] was used for swagger testing, lets try that
AAnchy9/29/2022
I was reading this stack overflow post that stated
The FromForm attribute is for incoming data from a submitted form sent by the content type application/x-www-form-urlencoded while the FromBody will parse the model the default way, which in most cases are sent by the content type application/json, from the request body.
The FromForm attribute is for incoming data from a submitted form sent by the content type application/x-www-form-urlencoded while the FromBody will parse the model the default way, which in most cases are sent by the content type application/json, from the request body.
https://stackoverflow.com/questions/50453578/asp-net-core-fromform-and-frombody-same-action
OObel9/29/2022
Thanks, that was literally the problem
AAnchy9/29/2022
nice

Looking for more? Join the community!

Want results from more Discord servers?
Add your server
Recommended Posts
Execute multiple steps with error checking [Answered]I have multiple steps that would be executed one by one with error checking after completing each stWindow opacity isn't being affected?I have a button click method over here that should set a window to opaque: ```cs private voiCoding winforms on ubuntu? is it possible now? if yes how?Can I work with winforms on ubuntu? I know winforms used to be limited to windows only, is it still System.Net.Sockets spookynessHello! : I've been tasked with updating our web app backend to .net 6 and I am almost done. HoweveINotifyDataErrorInfo helpWhen using the implementation for INotifyDataErrorInfo, is it possible when raising errors change evHow to pass value to parameter that require IEnumable string [Answered]Help me with the syntaxIs Array.Copy decent for copying sections of memory?I'm making a thing which relies pretty heavily on copying (not very large) sections of memory insideRelationship between Microsoft.AspNetCore.Identity.EntityFrameworkCore and AADHey guys, I read a bunch of Azure Active Directory documents and see that they recommend us not to sMSIX URI is inaccessible in AppinstallerHello, I have an Appinstaller and MSIX hosted in a public Google Cloud Storage bucket, meaning theyI'm having problems with a range of numbers and random generator (im new)I have an array of number (1-50, scaled), where one will be selected randomly and then every number EFCore Updating an item after mapping with AutomapperHey I am using Ef core to store some data in sqlite. I need to translate it to another object to shoIs it possible to allow an installer to downgrade dll's while not overwriting other app files?When creating an installer. (using Wix) Is there a way to have better control over the reinstall proIs there any way to simplify this, or a design pattern I should be following?```cs public event EventHandler<FizzbuzzDetermineNumberRequest>? DetermineNumberRequestHandlers; How to get service that not registed with interfaceHelpAssigning all StackPanel child element marginI am trying to set the margin for all elements in stackpanel from resor. Can you point out why it's Generics and type inference```cs public TDest MapTo<TSource, TDest>(TSource src) { var res = _mapper.Map<TSourcCrash of the background worker because of the SQL connectionI have a background worker running on some machine, which getting random crashes because of the SQL Minimum need data to create an EntityMy entity: ```cs public class Book : BaseEntity { public string Name { get; set; } MediatR commands and DTOs [Answered]Currently, I am passing DTOs to my controllers, I am using MediatR and it supports commands. I use tHow can I send int value from 1 program, to another via internet?```fix Hello. Is there any easy way to connect 2 programs to each other over the internet? I mean,