EASendMail SMTP Component > Developer Center > VB - .NET Framework > Send Email with Queue in ASP.NET, VB.NET

Send Email with Queue in ASP.NET, VB.NET

Date: Feb 3, 2016

In previous section, I introduced how to send mass emails with multiple threads. In this section, I will introduce how to send email with EASendMail Service Queue in ASP.NET/VB.NET.

EASendMail Service is a light and fast email delivery service which works with EASendMail SMTP Component to enable your application to send mass emails in background queue service. Along with its ability to picking recipients from database in background and sending email in specified datetime, it eases your task in developing featured email application such as newsletter application. We strongly recommend you to use EASendMail Service with your ASP.NET/Web Application.

send email using queue in ASP.NET/VB

To work with EASendMail Service, please download EASendMail Service and install it on your server. If you are using web hosting service and you don't have permission to install service on that server, EASendMail service is not suitable for you.

With EASendMail email queue feature, you do not have to code for multiple threadings. EASendMail Service can send email in background with multiple threadings automatically. You just need to adjust the maximum worker threads in EASendMail Service Manager to increase the performance. Please click here to learn more detail about EASendMail Service.

If your networking connection to your SMTP server is not very fast, EASendMail Service is absolutely solution for you. You just need to submit the email to EASendMail service queue, it is very fast because EASendMail service uses shared memory to accept email from EASendMail component, and then the service will send email in background service. It is very important to improve the response time for ASP.NET web application.

Remarks: All of samples in this section are based on first section: Send email in a simple VB.NET project. To compile and run the following example codes successfully, please click here to learn how to create the test project and add reference of EASendMail to your project.

[VB.NET - Send Email with Queue - Example]

The following example codes demonstrate how to send email with EASendMail Service Queue in VB.NET. To get full sample projects, please refer to Samples section.

' The following example codes demonstrate sending email message using email queue
' To get full sample projects, please download and install EASendMail on your machine.
' To run it correctly, please change SMTP server, user, password, sender, recipient value to yours

' Add EASendMail namespace
Imports EASendMail 

Module Module1 
    Sub Main() 
        Dim oMail As New SmtpMail("TryIt") 
        Dim oSmtp As New SmtpClient() 

        ' Set sender email address, please change it to yours
        oMail.From = "test@emailarchitect.net" 

        ' Set recipient email address, please change it to yours
        oMail.To = "support@emailarchitect.net" 

        ' Set email subject
        oMail.Subject = "test email from VB.NET project" 

        ' Set email body
        oMail.TextBody = "this is a test email sent from VB.NET project, do not reply" 

        ' Your SMTP server address
        Dim oServer As New SmtpServer("smtp.emailarchitect.net") 

        ' User and password for ESMTP authentication, if your server doesn't require
        ' User authentication, please remove the following codes.
        oServer.User = "test@emailarchitect.net" 
        oServer.Password = "testpassword" 

        ' If your smtp server requires SSL connection, please add this line
        ' oServer.ConnectType = SmtpConnectType.ConnectSSLAuto


            Console.WriteLine("start to send email ...") 
            ' You just need to change SendMail method to SendMailToQueue method in 
            ' your ASP.NET web application, then EASendMail uses queue to send email.
            ' SendMailToQueue can be used in windows application as well.
            oSmtp.SendMailToQueue(oServer, oMail) 
            Console.WriteLine("email was sent queue successfully!") 

        Catch ep As Exception 

            Console.WriteLine("failed to send email with the following error:") 
        End Try 

    End Sub 
End Module 
Next Section

At next section I will introduce how to send mass emails with EASendMail Service Database Queue in ASP.NET/VB.

< Prev:Send email with multiple threads (Mass Mail) in VB.NET | Next: Send mass emails with EASendMail Service Database Queue in ASP.NET/VB.NET >

Expand All Sections >> 1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  


Process Bounced Email (Non-Delivery Report) and Email Tracking
Bulk Email Sender Guidelines


If you have any comments or questions about above example codes, please click here to add your comments.

Send Email - C# - VB6 - Visual Basic - VC++ - C++/CLI - Delphi

Retrieve Email and Parse Email - C# - VB6 - Visual Basic - VC++ - C++/CLI - Delphi

Email Solution - Email Server - DomainKeys and DKIM - Disclaimer

2003 - 2016 © Copyright AdminSystem Software Limited. All rights reserved.   About us     Follow emailarchitect on Twitter   Follow emailarchitect on facebook