I am using Visual studio with c#.
I want to send an automatic mail to the user’s external email address.
For that I found many useful code snippets.
But in all I have clarify the SMTP.Host like
Smtp.Host = "smtp.gmail.com"; // for example gmail smtp server
Write now i am working in the local host only.
So what will be the code for that.
Thanks in advance.
You need to decide which server is to actually sent the email. In your example, Google is sending the email (which also means you need an account there to sent the email from). If you have an SMTP server running on your localhost, then the SMTP-server would be
localhost.Basically, the SMTP server (and credentials) refer to the machine that sends the email.