Send Email To Multiple Recipients | Blog - Limilabs
Có thể bạn quan tâm
- Products
- Services
- Support
- Blog
- About us
- Products
- Services
- Support
- Blog
- About us
In this post we’ll show how to send email message to multiple recipients.
If your email should look differently for each recipient (customized “Hello [FirstName] [LastName]” message) take a look at:- Email template engine
- VERP (Variable Envelope Return Path)
If your email looks exactly the same for each recipient the easiest way is to use BCC field (Blind-Carbon-Copy), and specify Undisclosed recipients group as the message recipient:
MailBuilder builder = new MailBuilder(); builder.From.Add(new MailBox("[email protected]", "Alice")); builder.To.Add(new MailGroup("Undisclosed recipients")); builder.Bcc.Add(new MailBox("[email protected]", "Bob")); builder.Bcc.Add(new MailBox("[email protected]", "Tom")); builder.Bcc.Add(new MailBox("[email protected]", "John"));Here’s entire sample, that creates email message, connects to SMTP server and sends the message:
// C# version MailBuilder builder = new MailBuilder(); builder.From.Add(new MailBox("[email protected]", "Alice")); builder.To.Add(new MailGroup("Undisclosed recipients")); builder.Bcc.Add(new MailBox("[email protected]", "Bob")); builder.Bcc.Add(new MailBox("[email protected]", "Tom")); builder.Bcc.Add(new MailBox("[email protected]", "John")); builder.Subject = "Put subject here"; builder.Html = "Put <strong>HTML</strong> message here."; // Plain text is automatically generated, but you can change it: //builder.Text = "Put plain text message here."; IMail email = builder.Create(); // Send the message using (Smtp smtp = new Smtp()) { smtp.Connect("server.example.com"); // or ConnectSSL for SSL smtp.UseBestLogin("user", "password"); // remove if not needed smtp.SendMessage(email); smtp.Close(); } ' VB.NET version Dim builder As New MailBuilder() builder.From.Add(New MailBox("[email protected]", "Alice")) builder.[To].Add(New MailGroup("Undisclosed recipients")) builder.Bcc.Add(New MailBox("[email protected]", "Bob")) builder.Bcc.Add(New MailBox("[email protected]", "Tom")) builder.Bcc.Add(New MailBox("[email protected]", "John")) builder.Subject = "Put subject here" builder.Htm = "Put <strong>HTML</strong> message here." ' Plain text is automatically generated, but you can change it: 'builder.Text ="Put plain text message here." Dim email As IMail = builder.Create() ' Send the message Using smtp As New Smtp() smtp.Connect("server.example.com") ' or ConnectSSL for SSL smtp.UseBestLogin("user", "password") ' remove if not needed smtp.SendMessage(email) smtp.Close() End UsingQuestions?
Consider using our Q&A forum for asking questions..NET components
- Barcode.dll barcode component
- Ftp.dll FTP/FTPS component
- Mail.dll email component
Blog
- Entries (RSS)
Contact
Limilabs™
VAT: PL 5213195875 Regon: 145938780 Pulawska 115/18 02-707, Warsaw Poland
Limilabs™ © 2004-2025. All rights reserved. | Terms of Use | Privacy PolicyTừ khóa » Visual Basic Send Email Multiple Recipients
-
Sending Email To Multiple Recipients In VB.NET - Stack Overflow
-
Thread: Sending Email To Multiple Addresses - VBForums
-
Send Email To Multiple Recipients In C#, VB, C++/CLI, JScript.NET
-
[Solved] Send Mail To Multiple Recipient - CodeProject
-
.Net 2.0 Send Email With Multiple “To” Recipients - MSDN - Microsoft
-
Sending Email To Multiple Recipients Using ASP.Net - C# Corner
-
Send Email From Excel To Multiple Recipients Using VBA And Outlook
-
Send Email To Multiple Recipients Using VBA | MrExcel Message Board
-
How To Send Email To Multiple Recipients In A List From Excel Via ...
-
Outlook Send Same Email To Different Recipients | VBA Macro #31
-
Sending Email To Multiple Recipients, Vba - Excel
-
How To Send Email To Multiple Recipients With Addresses Stored ...
-
Sending Emails To Multiple Recipients - Visual Basic .NET