|
|
|
|
|
|
|
How to create HTML emails featuring barcode images with System.Net.Mail classes in Windows Forms (VB.NET and C#)
Prerequisites
- Neodynamic Barcode Professional 3.0 (or greater) for Windows Forms (WinControl)
- Microsoft .NET Framework 2.0 (or greater)
- Microsoft Visual Studio 2005
- Microsoft Visual Studio 2005 Express Editions (VB, C#, J#, and C++)
|
In the following Step-By-Step Guide we're going to create a simple Windows Form which lets you to generate and send HTML emails featuring barcode images (some useful scenarios may involve any kind of barcode tickets, newsletters, invitations, and so on) created by Barcode Professional for Windows Forms and the System.Net.Mail classes.
Follow these steps:
- Open Visual Studio and create a Windows Forms application project.
- Add a reference to Neodynamic.WinControls.BarcodeProfessional.dll assembly.
- Design the created Windows Form so it looks like the following figure. Add a TextBox and a Button control.
- In the class file of the form write the following private method called GetBarcodeImage() which will generate a barcode image encoding a random value by using Barcode Professional so it can be embedded into the HTML email.
Visual Basic .NET
Visual C# .NET
- Now code the button's click event. In the button's click event procedure we are going to generate the HTML email by using System.Net.Mail classes embedding the barcode image generated by the aforementioned private method.
Visual Basic .NET
Visual C# .NET
- That's it. Build your project and test it. IMPORTANT: Remember to specify a VALID "FROM" EMAIL ACCOUNT AS WELL AS A VALID SMTP SERVER in the code above.
You should get something like the following figure.
- After you specify a valid email address and click on "Send Barcode Ticket" a HTML email with barcode image will be send to you.
If you need more information or assistance, please contact our
.
|
|
|
|
|
|
|