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

iPod shuffle offer

For a limited time get the newly re-designed iPod shuffle free with qualifying purchase.

Click for details.


News

JSCAPE is Hiring
06/27/2008 02:34 PM

JSCAPE Secure FTP Server 4.0 Released
06/20/2008 08:53 AM

Secure iNet Factory 8.0.3 Released
06/11/2008 08:20 AM

Community forums launched
06/08/2008 06:09 AM

Secure iNet Factory 8.0 Released
04/04/2008 02:24 PM

Updates to Email Factory for .NET and Secure iNet Factory
03/29/2008 04:06 PM

more...


Tutorials

Email Validation with Java
04/15/2008 02:04 PM

Sending HTML Based Email Using Java
03/11/2008 02:47 PM

Secure FTP Using Java and FTPS (FTP over SSL)
03/10/2008 04:08 PM

FTP Directory Listing Using Java
03/10/2008 03:57 PM

Sending Email Using Java
03/09/2008 03:43 PM

SSH Using Java
03/09/2008 02:53 PM

more...


Articles

Best Practices for Configuring Your FTP Server
06/03/2008 04:47 PM

What is the difference between passive and active FTP?
05/20/2008 09:27 AM

What is the difference between FTP, FTPS and SFTP?
05/19/2008 04:29 PM

DMZ File Transfer Streaming
03/28/2008 11:57 AM

Phishing looks to FTP to distribute malware
03/13/2008 05:14 PM

Ad Hoc File Transfer Explained
03/13/2008 09:16 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