❔ Send mail using API in Blazor WebApp
I am trying to use a form to send mail vai an API from .Net core . How can I implement the logic in the blazor side.
Help me with the code in the blazor page.
Thanks!
![](https://answer-overflow-discord-attachments.s3.amazonaws.com/1130397113700864000/image.png)
![](https://answer-overflow-discord-attachments.s3.amazonaws.com/1130397113998651412/image.png)
![](https://answer-overflow-discord-attachments.s3.amazonaws.com/1130397114300645406/image.png)
9 Replies
What logic do you want to implement on Blazor side?
Sending the email through the form using the Api
Doing that on client-side is not a good idea
i am trying to use an API in the client side
You mean your own API controller?
If that's the case, just use
HttpClient
I am using IFormFile for the attachment. In th blazor form while I send the attachment. It is requested as null.
this is the way I am implementing the logic. The attachment is null from the request in this case.
![](https://answer-overflow-discord-attachments.s3.amazonaws.com/1130754836376326274/image.png)
![](https://answer-overflow-discord-attachments.s3.amazonaws.com/1130754836611223632/image.png)
@angius
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.