This is my first time to write a program that sends mails. I don’t know what to put in the SMTP client constructor :
SmtpClient client = new SmtpClient(????);
Can anybody help?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Always consult the documentation. The SmptClient has three constructors.
If you choose the last one, then your code would look like the following, for gmail:
You could also use the first constructor and set properties instead.