简体   繁体   English

操作已超时-SMTP邮件-多个收件人

[英]Operation has timed out - SMTP Mail - Multiple recipients

this is my scenario: I'm trying to send mail with SMTP client, when I try to send the mail to max 3 recipient, that worked perfectly, but, when the recipients number is higher than 3, it return "Operation has timed out". 这是我的情况:我尝试使用SMTP客户端发送邮件,当我尝试将邮件发送给最大3个收件人时,这很好用,但是,当收件人数大于3时,它返回“操作已超时”。

 MailMessage mail = new MailMessage();
 SmtpClient smtpServer;
 if ((smtpPort != null) && (smtpPort != string.Empty))
        smtpServer = new SmtpClient(smtpAddress, getInt(smtpPort,25));
            else
                            smtpServer = new SmtpClient(smtpAddress);
                        mail.From = new System.Net.Mail.MailAddress(senderAddress, senderName);
                        if (null != to)
                            foreach (string toElement in to)
                                mail.To.Add(toElement);
                        if (null != cc)
                            foreach (string ccElement in cc)
                                mail.CC.Add(ccElement);
                        if (null != bcc)
                            foreach (string bccElement in bcc)
                                mail.Bcc.Add(bccElement);
                        mail.Subject = subjectString;
                        mail.Body = message;

                        if (mailFilename != null)
                        {
                            System.Net.Mail.Attachment attachment;
                            foreach (string path in mailFilename)
                                if (System.IO.File.Exists(eMailPath.Replace("timestamp", path) + path + ".eml"))
                                {
                                    attachment = new System.Net.Mail.Attachment(eMailPath.Replace("timestamp", path) + path + ".eml");
                                    mail.Attachments.Add(attachment);
                                }
                        }
                        smtpServer.Send(mail);
     }

Question Can I split sending so that the multiple recipients can see other recipients as if the sending is one? 问题我可以拆分发送,以便多个收件人可以看到其他收件人,就像发送一次一样吗?

Example

Recipients list: a@dom.it, b@dom.it, c@dom.it, mailingList@dom.it --> the mailing list is composed by 4 recipients. 收件人列表:a @ dom.it,b @ dom.it,c @ dom.it,mailingList @ dom.it->邮件列表由4个收件人组成。

Original send: To: mailingList@dom.it CC:a@dom.it,b@dom.it BCC:c@dom.it 原始发送:收件人:mailingList@dom.it抄送:a @ dom.it,b @ dom.it密件抄送:c@dom.it

I want to split sending in way that the various recipients can see other recipients like the original sending. 我想以不同的方式拆分发送,以便各个收件人可以看到其他收件人,例如原始发送。

I don't see anywhere that you're setting the .Host property on the SMTPClient object. 我看不到在SMTPClient对象上设置.Host属性的任何地方。 So, it's probably sending out through the local SMTP server by default, and I'm guessing that you may be hitting some limit on this local SMTP server, or it's throttling, or something of that sort. 因此,默认情况下,它可能是通过本地SMTP服务器发送出去的,我猜测您可能在此本地SMTP服务器上遇到了一些限制,或者它正在节流,或者类似的限制。 Perhaps using the .Host property to route these outgoing messages through some other SMTP server (eg smtp.gmail.com) might solve the problem. 也许使用.Host属性通过其他一些SMTP服务器(例如smtp.gmail.com)路由这些传出邮件可能会解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM