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 answers
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#
- How to call a C language function from x86 assembly code?
- What does: "char *argv[]" mean?
- User input sanitization program, which takes a specific amount of arguments and passes the execution to a bash script
- How to crop a BMP image in half using C
- How can I get the difference in minutes between two dates and hours?
- Why will this code compile although it defines two variables with the same name?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Why can't I use the file pointer after the first read attempt fails?
- #include Header files in C with definition too
- OpenCV2 on CLion
- What is causing the store latency in this program?
- How to refer to the filepath of test data in test sourcecode?
- 9 Digit Addresses in Hexadecimal System in MacOS
- My server TCP doesn't receive messages from the client in C
- Printing the characters obtained from the array s using printf?
Related Questions in SMTPCLIENT
- I started getting: Client not authenticated to send mail errors
- How to DKIM sign and send email in .NET Core using Office 365 Email Server?
- GSSAPI operation failed with error - Unspecified GSS failure. Minor code may provide more information
- System.Net.Mail.SmtpException: The server committed a protocol violation. On a dotnet 8 application running in a alpine image
- System.Net.Mail.SmtpException-SocketException: A connection attempt failed because the connected party did not properly respond after a period of time
- MailKit.Security.AuthenticationException: '535: 5.7.139 Authentication unsuccessful, user is locked by your organization's security defaults policy
- Send email on .net core application hosted on docker not work
- SmtpClient fail to send email using Amazon SES endpoint
- How to write unit test case and Mock SmtpClient Send mail
- Email send not working with smtp configuration through c#
- SmtpClient.Send() times out after sending a couple of mails
- Why does my SMTP TLS v1.3 connection attempt result in Win32Exception: The Local Security Authority cannot be contacted
- SMTP setup is timing out the connection
- Unable to render the Exchange Email attachment properly after adding as MailAttachment for smtp
- SMTP exception - SMTPAddressFailedException
Related Questions in SYSTEM.NET.MAIL
- Why am I getting 'Authentication required' error when sending email in Android .NET MAUI?
- how to add retry times or max attemp time in powershell with O365
- Sending an Email using VB.NET and smtp.office365.com
- c# and issues with email
- (Solved) Why is smtp not sending email on published Blazor Server app?
- Cannot send SMTP Email from Outlook VSTO Addin
- cannot send a message with an href in a message body in c# with System.net.mail
- System.Net.Mail SmtpClient c#
- VB SMTP through System.Net.Mail stopped working
- How to continue using system.net.mail to send emails after google disabled the 'less secure apps' option? C#
- Which library to use for sending email in c#?
- Unrecognized configuration section system.net
- Force System.Net.Mail.SmtpClient to encode the Subject header using Base64
- Office 365 email configuration throws an exception
- Sending mail through SmtpClient and smtp.office365.com setting email's sensitivity to normal, personal, private or confidential
Related Questions in SENDASYNC
- Which approach is better use of HttpClient in .NET Framework 4.7?
- How can I Mock HttpResponseMessage SendAsync in VB.NET?
- HttpMethod.Get -- System.Net.ProtocolViolationException: 'Cannot send a content-body with this verb-type.'
- Getting issue while using HttpClient/HttpClientFactory in .net core
- .Net Framework - HttpClient SendAsync Error - Unable to read data from the transfer connection: the connection has been closed
- Modify RequestUri in C# WebApi
- Sendasync has stopped working , Not Posting data from swagger
- How to send a post request in dotnet with a list of request headers
- C# HttpClient.SendAsync causes error, cannot send a content-body with this verb-type
- Sending syncronously with System.Net.WebSockets.SendAsync
- HttpClient.SendAsync on Blazor WASM returns empty HttpResponseMessage although Fiddler shows that correct response was received
- .NET: Unable to read data from the transport connection: The I/O operation has been aborted
- Sending Messages One-Way Only Through a Asp.Net Core WebSocket
- HttpClient.SendAsync in DotNetCore - Is a Deadlock Possible?
- How to write responses of multiple asynchronous get requests to a single file in asynchronous httpclient java 11?
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?
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)
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.