Send-MailMessage closes every 2nd connection when using attachments

后端 未结 2 430
温柔的废话
温柔的废话 2021-01-15 03:45

I am attempting to write a powershell script to send email with a few attachments to 30 people. The emails are personalized, so they must be sent individually. The script wo

2条回答
  •  借酒劲吻你
    2021-01-15 04:34

    The error seems to indicate a transport layer issue. Without knowing your network architecture it's a little tough to know for sure. Try this:

    Maybe add a wait to your foreach loop to see if there is a server that is throttling (for lack of better word) your messages. Without access to the server config, your hack is likely the best you can do with this.

    As far as your try/catch solution, that is going to produce the fastest success on your end, however, it will increase network traffic. You are essentially brute forcing your way past whatever limits you are hitting.

提交回复
热议问题