Send email ASP.NET Core | Contact form example

preview_player
Показать описание
Creating a contact form that send email ASP.NET Core. Logic can also be implemented in an ASP.NET web API or just a C# script.
Copy/paste code:

00:00 Introduction
00:26 Contact form
01:08 OnPost Method
02:31 SendMail Method
10:03 Testing
11:19 Adding Success and Fail message to form
14:10 Ending

---------------------------------------------------------------------------------------------

🎮 My Top Gaming Gear 🎮

💻 My Top Software 💻
Рекомендации по теме
Комментарии
Автор

Very good the only tutorial that worked for me, thank you. Keep going!

neiserdiaz
Автор

If you get an error to the effect of
'Object reference not set to an instance of an object.'
returned null.

Make sure that the method has been instantiated and passed to the view in your home controller. IE:

public IActionResult Index()

{
//The index model is used for the contact form
return View(new IndexModel());
}

russellgeary
Автор

Very nice tutorial, now how to make it work into Blazor server?
Like your Create a Blog series, which was also excellent.

kxpn
Автор

Nice Video ! But in my case, from user send request to API by Ajax, API call DataAccess and response the request to client, how can i do it ?

mduy
Автор

does "message.From = new MailAddress("Email");" have to be a an active email? or can it be anything?

salmourad
Автор

The Copy/paste code link is not working. Can you update another one? please? Thank you

KwokHoLeung
Автор

I couldn't get it to work. I'm using asp.net core mvc. I don't know what wrong because it doesn't throw errors. I submit the application and nothing happens.

tchivchiv