What it says on the tin.
Why can't you send multiple emails asynchronously using the same SmtpClient instance?
4k Views Asked by James At
2
There are 2 best solutions below
9
Darin Dimitrov
On
According to MSDN:
After calling SendAsync, you must wait for the e-mail transmission to complete before attempting to send another e-mail message using Send or SendAsync.
So you could reuse the same instance but you must wait for the first mail to be sent.
Related Questions in C#
- Passing arguments to main in C using Eclipse
- kernel module does not print packet info
- error C2016 (C requires that a struct or union has at least one member) and structs typedefs
- Drawing with ncurses, sockets and fork
- How to catch delay-import dll errors (missing dll or symbol) in MinGW(-w64)?
- Configured TTL for A record(s) backing CNAME records
- Allocating memory for pointers inside structures in functions
- Finding articulation point of undirected graph by DFS
- C first fgets() is being skipped while the second runs
- C std library don't appear to be linked in object file
- gcc static library compilation
- How to do a case-insensitive string comparison?
- C programming: Create and write 2D array of files as function
- How to read a file then store to array and then print?
- Function timeouts in C and thread
Related Questions in SMTPCLIENT
- How to best manage SMTP clients
- Sending an Email via c#.net SmtpClient doesn't work properly
- SMTP Email not sending
- SMTPException Syntax error, message content is not acceptable here
- HTML email sent by SMTPclient gets Office365 disclaimer inserted before body
- Reliability of C# SmtpClient email code (when images are involved)
- Outlook SMTPClient server error 5.3.4 5.2.0
- SMTP Connection takes time to connect after Dispose
- Email not sending ASP.NET MVC 4 Using SMTPClient
- Generating an email using either AutodiscoverURL or SmtpClient
- Exchange 2016 SMTP Intermittent Error 5.7.57
- Failure sending mail - c# - godaddy
- Issue with Google smtp ASPMX.L.GOOGLE.COM
- SmtpClient.SendAsync not sending email versus SmtpClient.Send
- System.Net.Mail.SmtpClient - Client does not have permission to send as this sender
Related Questions in SYSTEM.NET.MAIL
- Unicode character in email not throwing exception
- Remove To and BCC Addresses using System.Net.Mail
- Missing new line in MailMessage sent by System.Net.Mail.SmtpClient
- Send mail with System.Net.Mail
- Convertto-HTML outputting pre/post content showing up as System.String[] instead of actual content
- Problem with Send Mail IIS System.Net.Mail Namespace Visual Basic visual-studio-2010
- SmtpFailedRecipientsException Not working
- embedding image not displaying in emaill using vb.net
- Clone or make a MailMessage Immutable in .NET / C#
- Mailmessage.from not working as expected
- how to email a dynamically created htmltable - vb.net
- System.Net.Mail works as localhost but when I add it to my web server it does not
- Correct Syntax for Generating HTML Email using AlternateView
- System.Net.Mail.MailMessage/System.Net.Mail.SmtpClient Sending Duplicate Emails
- Odd error when attaching files with System.Net.Mail
Related Questions in SENDASYNC
- WebAPI is returning 200 but the SendAsync call shows 500
- How to understand C# SendAsync function?
- Post content stream gets bufferend when using compression on content-block
- C# UWP Socket: using ReceiveAsync / SendAsync and handling a timeout without closing the socket
- C# - about Windows.Forms Timer and SMTPClient.SendAsync
- How to write responses of multiple asynchronous get requests to a single file in asynchronous httpclient java 11?
- Sending mail slow on IIS 7
- SmtpClient.SendAsync Method (MailMessage, Object) doesn't function in a asynchronous way
- C#: Trouble with socket ReceiveAsync and SendAsync on Remote Host
- Why can't you send multiple emails asynchronously using the same SmtpClient instance?
- SmtpClient.SendAsync - How to stop the application exiting before the callback is triggered?
- Is SmtpClient.SendAsync() really faster than SmtpClient.Send()
- Sending Messages One-Way Only Through a Asp.Net Core WebSocket
- SendAsync Smtp Mail Error
- .Net Framework - HttpClient SendAsync Error - Unable to read data from the transfer connection: the connection has been closed
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
According to the MSDN page on SmtpClient, the only purpose for SendAsync is to allow your current thread to continue processing instead of waiting for the transmission to process. The purpose of SendAsync isn't to allow you to send multiple messages at once, it's to allow you to continue processing while it sends the message. SendAsync and Send are both using the same pipeline, SendAsync just allows you to do other things while the message is sent.