How to send a mail through mvc-3 asp.net using c#?
I have to send a forgot password so how can I do this? My code is below.
Model code..
usi
It look like you are trying to send emails through GMail's SMTP service, which this SO question already covers: Sending email in .NET through Gmail
The only thing that looks missing in your code is that you've set client.UseDefaultCredentials = true
, I think you want to set this to false
and provide your own credentials. I've never tried using GMail to send through emails, but I'm guessing you'll need to use a GMail account as your credentials in order to authenticate properly.