问题描述
我试过这段代码。但是它显示错误。
我尝试过:
System.Net.Mail.MailMessage Email = new System.Net.Mail.MailMessage([email protected],YourEmail.Text);
Email.Subject = YourSubject.Text;
Email.Body = Comments.Text;
System.Net.Mail.SmtpClient mailClient = new System.Net.Mail.SmtpClient();
//此对象存储身份验证值
System.Net.NetworkCredential basicAuthenticationInfo = new System.Net.NetworkCredential([email protected],9583364957);
//将您自己或您的ISP邮件服务器名称放在下一行
mailClient.Host =Mail.Gmail.com;
mailClient.UseDefaultCredentials = false;
mailClient.Credentials = basicAuthenticationInfo;
mailClient.Send(Email);
i have tried this code.but it shows error.
What I have tried:
System.Net.Mail.MailMessage Email = new System.Net.Mail.MailMessage("[email protected]", YourEmail.Text);
Email.Subject = YourSubject.Text;
Email.Body = Comments.Text;
System.Net.Mail.SmtpClient mailClient = new System.Net.Mail.SmtpClient();
//This object stores the authentication values
System.Net.NetworkCredential basicAuthenticationInfo = new System.Net.NetworkCredential("[email protected]", "9583364957");
//Put your own, or your ISPs, mail server name onthis next line
mailClient.Host = "Mail.Gmail.com";
mailClient.UseDefaultCredentials = false;
mailClient.Credentials = basicAuthenticationInfo;
mailClient.Send(Email);
推荐答案
这篇关于邮件发送有问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!