Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Improving performance sending emails to Office 365
Message
From
31/03/2017 11:26:54
 
 
To
All
General information
Forum:
VB.NET
Category:
Optimization
Title:
Improving performance sending emails to Office 365
Environment versions
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows Server 2012
Database:
Visual FoxPro
Application:
Web
Miscellaneous
Thread ID:
01649603
Message ID:
01649603
Views:
51
I have this class which sends emails to SMTP servers. When managing our own SMTP servers, either locally or across the Internet, sending emails was a walk in the park, as far as performance goes. I could send dozens of emails within seconds. Now, I have an implementation which goes to Office 365 with SSL authentication. Each email takes 3 seconds to be delivered. I am trying to know if the bottleneck is because there is now SSL, if this is because of the backend, or a mix of both.

The class uses an approach like this:
Dim loEmail As MailMessage = New MailMessage
Dim loNetworkCredential As System.Net.NetworkCredential = Nothing
Dim loSmtpClient As SmtpClient = New SmtpClient

loEmail.Subject = cSubject
loEmail.Body = cBody
loSmtpClient.Host = cSMTP
loSmtpClient.Port = nPort
loSmtpClient.EnableSsl = lEnableSsl

' If we have Ssl
If lEnableSsl Then
   loNetworkCredential = New System.Net.NetworkCredential(cUsername, cPassword)
   loSmtpClient.Credentials = loNetworkCredential
End If
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Reply
Map
View

Click here to load this message in the networking platform