I'm using this piece of code to send a mail:
SmtpClient client = new SmtpClient();
client.Host = smtpServer;
client.Send(mailMessage);
If I trigger this code ten times/second, then after some hundred mails, sending a mail takes 10 seconds... Could there be a queue involved here?
The SmtpClient class is obsolete in Xamarin. However: It is included in the . NET Standard 2.0 and later versions and therefore must be part of any .
By default, a single SMTP transport creates a single connection and re-uses it for the lifetime of the script execution. You may send multiple e-mails through this SMTP connection. A RSET command is issued before each delivery to ensure the correct SMTP handshake is followed.
Add(new MailAddress(ccEmail)); Msg. Bcc. Add(new MailAddress(bccEmail)); } SmtpClient a = new SmtpClient("smtp server name"); a. Send(Msg); sreader.
You can generally find your SMTP email server address in the account or settings section of your mail client. When you send an email, with SMTP host Gmail or AOL, the SMTP server processes your email, decides which server to send the message to, and relays the message to that server.
Use SmtpClient.SendAsync rather than SmtpClient.Send.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With