Confused with the SmtpClient.UseDefaultCredentials Property
问题 In my MVC4 application, I am using the SmtpClient to send out email via Gmail's smtp.gmail.com SMTP server. I have configured my Web.Config file with the following settings: <system.net> <mailSettings> <smtp deliveryMethod="Network"> <network enableSsl="true" defaultCredentials="false" host="smtp.gmail.com" port="587" userName="xxMyUserNamexx@gmail.com" password="xxMyPasswordxx" /> </smtp> </mailSettings> </system.net> The method that uses the SmtpClient and sends an email message looks like: