<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>VBForums - C#</title>
		<link>https://www.vbforums.com/</link>
		<description>This forum is for all C# questions.</description>
		<language>en</language>
		<lastBuildDate>Sun, 19 Jul 2026 07:58:59 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>https://www.vbforums.com/images/misc/rss.png</url>
			<title>VBForums - C#</title>
			<link>https://www.vbforums.com/</link>
		</image>
		<item>
			<title><![CDATA[[RESOLVED] C# application getting error using SMTP for one user who got a new computer]]></title>
			<link>https://www.vbforums.com/showthread.php?912101-RESOLVED-C-application-getting-error-using-SMTP-for-one-user-who-got-a-new-computer&amp;goto=newpost</link>
			<pubDate>Tue, 23 Jun 2026 13:23:06 GMT</pubDate>
			<description><![CDATA[There is a function in my application where a user creates an Excel file and sends it as an attachment to a group email, let's call it salessupport@vbforums.com, using SMTP.  A user who has always been able to do this successfully until yesterday is getting this exception.  I wrote this block of code yesterday to catch SmtpFailedRecipientsException when I was getting a very general exception "Unable to send to all recipients".  This message is not much better.  It says Failed Recipient: <salessupport@vbforums.com> Status Code: Mailbox unavailable.


Code:
---------
                        // 06/22/26 - Code from google search of "c# SmtpClient message unable to send to all recipients".
                        catch (SmtpFailedRecipientsException ex)
                        {
                            // Loops through only the specific recipients that failed
                            foreach (SmtpFailedRecipientException innerEx in ex.InnerExceptions)
                            {
                                //Console.WriteLine($"Failed recipient: {innerEx.FailedRecipient}");
                                //Console.WriteLine($"SMTP Status Code: {innerEx.StatusCode}");
                                MessageBox.Show(String.Format("Failed Recipient: {0} Status Code: {1}", innerEx.FailedRecipient, innerEx.StatusCode));
                            }
                        }
---------
The mailbox should not be unavailable.  Another user sent it fine.  So I don't think it's my code, I think it's the user's "new computer".  Does anybody know of something that needs to be set up/configured to be able to do this?  What about the new computer is relevant: OS, programs installed, etc.?  I think I can fix the problem by taking the 5 or so people who are in the group and adding them one at a time to the MailMessage.To list, but that won't really help us know what this problem is and I would like to know that.  Thank you for any insight.]]></description>
			<content:encoded><![CDATA[<div>There is a function in my application where a user creates an Excel file and sends it as an attachment to a group email, let's call it <a href="mailto:salessupport@vbforums.com">salessupport@vbforums.com</a>, using SMTP.  A user who has always been able to do this successfully until yesterday is getting this exception.  I wrote this block of code yesterday to catch SmtpFailedRecipientsException when I was getting a very general exception &quot;Unable to send to all recipients&quot;.  This message is not much better.  It says Failed Recipient: &lt;salessupport@vbforums.com&gt; Status Code: Mailbox unavailable.<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // 06/22/26 - Code from google search of &quot;c# SmtpClient message unable to send to all recipients&quot;.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; catch (SmtpFailedRecipientsException ex)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Loops through only the specific recipients that failed<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; foreach (SmtpFailedRecipientException innerEx in ex.InnerExceptions)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //Console.WriteLine($&quot;Failed recipient: {innerEx.FailedRecipient}&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //Console.WriteLine($&quot;SMTP Status Code: {innerEx.StatusCode}&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox.Show(String.Format(&quot;Failed Recipient: {0} Status Code: {1}&quot;, innerEx.FailedRecipient, innerEx.StatusCode));<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</code><hr />
</div>The mailbox should not be unavailable.  Another user sent it fine.  So I don't think it's my code, I think it's the user's &quot;new computer&quot;.  Does anybody know of something that needs to be set up/configured to be able to do this?  What about the new computer is relevant: OS, programs installed, etc.?  I think I can fix the problem by taking the 5 or so people who are in the group and adding them one at a time to the MailMessage.To list, but that won't really help us know what this problem is and I would like to know that.  Thank you for any insight.</div>

]]></content:encoded>
			<category domain="https://www.vbforums.com/forumdisplay.php?30-C">C#</category>
			<dc:creator>MMock</dc:creator>
			<guid isPermaLink="true">https://www.vbforums.com/showthread.php?912101-RESOLVED-C-application-getting-error-using-SMTP-for-one-user-who-got-a-new-computer</guid>
		</item>
	</channel>
</rss>
