从带有附件的gmail发送Net.Mail时出错

时间:2019-01-20 21:08:38

标签: c#

我没有从四个附件中发送Gmail

{            
    MailMessage mail = new MailMessage();
    SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
    mail.From = new MailAddress(Form4.email);
    mail.To.Add("my@gmail.com");
    mail.Subject = "Subject";
    mail.Body = "See attachment";
    mail.IsBodyHtml = true;

System.Net.Mail.Attachment attachment1;
attachment1 = new System.Net.Mail.Attachment("C:/Tabliczka_Mnozenia/key_product.crt");
    mail.Attachments.Add(attachment1);
[...More 3 Attachment]
SmtpServer.Port = 465; 
SmtpServer.Credentials = new  System.Net.NetworkCredential("my@gmail.com", "Password");
    SmtpServer.EnableSsl = true;
    SmtpServer.Timeout = 90000;
SmtpServer.Send(mail);
}

错误发送:enter link description here

0 个答案:

没有答案