SMTP .NET Component - SMTP .NET, smtp .net component, smtp c#, smtp vb, smtp class
Home Search Knowledge Base Support

Support

Click here for access to live sales support.

For technical support please submit a ticket to the Help Desk.

 

Java and .NET Help

iTunes Gift Card Offer

For a limited time get a $50.00 iTunes gift card free with qualifying purchase.

Click for details.


News

JSCAPE Secure FTP Server 7.0 Released
08/20/2010 03:31 AM

JSCAPE launches Employee Giving Program
07/03/2010 08:26 AM

SSH Factory 3.6 Released
07/03/2010 06:22 AM

Secure iNet Factory 8.5 Released
07/03/2010 06:07 AM

Secure FTP Factory 8.5 Released
07/03/2010 06:03 AM

Secure FTP Applet 6.2 Released
06/10/2010 02:23 PM

more...


Tutorials

Enabling Phone Authentication
04/08/2009 11:24 AM

Detecting and Handling Brute Force Password Attacks
01/29/2009 09:44 AM

Creating a Domain
12/15/2008 11:33 AM

Public key authentication with SFTP
10/02/2008 07:59 AM

Formatting MimeMessages using .NET
09/14/2008 04:31 PM

Communicating with an IMAP4 server in .NET
09/14/2008 03:54 PM

more...


Articles

Open up corporate data to your partners
08/03/2010 10:01 PM

Access vital corporate documents on the go
07/01/2010 02:15 PM

SFTP and Encryption
05/17/2010 09:52 PM

Streamlining web uploads with ZIP archives
12/14/2009 10:11 AM

Using regular expressions in complex trigger conditions
09/08/2009 07:42 AM

Using custom forms to automate business processes
07/03/2009 08:51 AM

more...


Feedback

Request a feature or component

Request a Java or .NET component


 

SMTP .NET Component

The SMTP .NET Component provides an easy to use API to send email messages.

download email factory for .netpurchase email factory for .net

Features

  • 100% managed C# - A highly scalable solution with no dependencies on 3rd party libraries.
  • Easily add one or more attachments to email messages
  • HTML message support
  • Email address helper classes for creating and parsing email addresses.
  • Royalty-Free Distribution - No runtime fees!
  • Easily retrieve attachments from email messages.
  • Serialization support allows you to easily store email messages to disk or a database
  • International support for multiple character sets.
  • Thread safe - Critical code blocks are synchronized for use by multiple threads.
  • Event Model - Multiple events for capturing SMTP activity
  • Integrated Help - Automatic integration of Help 2.0 documentation for Visual Studio .NET


Code Example

The following C Sharp example demonstrates dynamically creating and sending an Email message using the Smtp .NET Component.

/*
 * SmtpExample.cs
 *
 * Copyright (c) 1999-2005 JSCAPE, LLC
 * 1147 S. 53rd Pl., Mesa, Arizona, 85206, U.S.A.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * JSCAPE ("Confidential Information"). You shall not disclose such
 * Confidential Information and shall use it only in accordance with
 * the terms of the license agreement you entered into with JSCAPE.
 */
using System;
using System.IO;
using System.Text;
using System.Threading;
using Jscape.Email;

namespace SmtpExample {

   public class SmtpExample {

      public Smtp mySmtp = null;

      public SmtpExample(string hostname){
         mySmtp = new Smtp(hostname);
         mySmtp.Debug = false;

         // Subscribe to events
         mySmtp.ConnectedEvent += new Smtp.ConnectedEventHandler(OnConnected);
         mySmtp.DisconnectedEvent += new Smtp.DisconnectedEventHandler(OnDisconnected);
         mySmtp.DataReceivedEvent += new Smtp.DataReceivedEventHandler(OnDataReceived);
         mySmtp.CommandSentEvent += new Smtp.CommandSentEventHandler(OnCommandSent);

         // create email message
         EmailMessage message = new EmailMessage();
         message.To = "ceo@ourserver.com, cto@ourserver.com";
         message.Cc = "sales@ourserver.com";
         message.From = "hr@ourserver.com";
         message.SetSubject("New employee Jän Freidman", "iso-8859-1");

         message.SetBody("Please welcome our newest employee.");

         // add attachment
         Attachment att = new Attachment(@"D:\hr\employees\resumes\freidman.doc");
         message.AddAttachment(att);
         // Connect to smtp server
         mySmtp.Connect();
         // Send email message;
         mySmtp.Send(message);
         // your server may require a slight delay in order to respond
         Thread.Sleep(100);
         // Disconnect from smtp server
         mySmtp.Disconnect();
      }


      public static void Main() {

         // default mail server
         string hostname = "mail.ourserver.com";

         // prompt for mail server
         Console.WriteLine("Smtp server: "+hostname);
         if ((hostname = Console.ReadLine()) != "") {
            SmtpExample smtpexample = new SmtpExample(hostname);
         }
      }


      public void OnConnected(object sender, SmtpConnectedEventArgs e) {
         Console.WriteLine("Connected to {0}", e.Host);
      }
      public void OnDisconnected(object sender, SmtpDisconnectedEventArgs e) {
         if (mySmtp.IsConnected()) {
            mySmtp.Disconnect();
         }
         Console.WriteLine("Disconnected.");
      }
      public void OnDataReceived(object sender, SmtpDataReceivedEventArgs e) {
         Console.WriteLine("Response: "+e.Response);
      }
      public void OnCommandSent(object sender, SmtpCommandSentEventArgs e) {
         Console.WriteLine("Command: "+e.Command);
      }
   }
}

download email factory for .netpurchase email factory for .net