我是 C# 新手,我正在尝试从我正在开发的桌面程序发送电子邮件。这是我正在使用的代码,但我不断收到以下错误:
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
message.To.Add("thesma@gmail.com");
message.Subject = "This is the Subject line";
message.From = new System.Net.Mail.MailAddress("ideas@gmail.com");
message.Body = "This is the message body";
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("smtp.gmail.com",578);
smtp.EnableSsl = true;
smtp.Send(message);
我似乎无法找出问题所在...