ActiveXperts Mobile Messaging Toolkit Add SMS capabilities to any Windows or .NET application

Quicklinks


Mobile Messaging Toolkit - Smtp object

Overview

The Simple Mail Transfer Protocol (SMTP) is a standard defined by the Internet Engineering Task Force (IETF) to facilitate electronic mail transfer using TCP/IP.

The SMTP object features the following:

  • Connect to secure SMTP servers (TLS/SSL)
  • Supports AUTH PLAIN, AUTH LOGIN and AUTH CRAM-MD5 login algorithms
  • Support for HTML and plain text alternative bodies
  • Support for multiple attachments
  • Support for embedded images
  • Load and save (import and export) MIME (.mim) files

The Smtp object is part of the ActiveXperts Mobile Messaging Toolkit. Overview of all Mobile Messaging Toolkit objects:

  • Gsm - Send and receive SMS messages using a GSM modem or a modem-capable GSM phone.
  • Smpp - Send and receive SMS messages via an SMPP provider.
  • SmppServer - Accept incoming SMPP connections.
  • Http - Send SMS messages through an HTTP based SMSC provider interface over the internet.
  • Dialup - Send SMS messages using a Hayes compatible modem through TAP/XIO or UCP.
  • Snpp - Send pager messages via an SNPP provider through the internet/VPN.
  • Smtp - Send e-mail messages through SMTP.
  • Pop3 - Receive e-mail messages through POP3.

Sample code

VBScript sample: Send an e-mail

  Set objSmtp = CreateObject("AxMmToolkit.Smtp")          ' Create the SMTP Protocol object
  Set objMail = CreateObject("AxMmToolkit.EmailMessage")  ' Create the e-mail message object

  ' Open a connection to the SMTP server
  objSmtp.SetSecure
  objSmtp.Connect "smtp.gmail.com", "me@gmail.com", "password"
  If objSmtp.LastError <> 0 Then
    WScript.Echo "Error: " & objSmtp.GetErrorDescription(objSmtp.LastError)  
    WScript.Quit
  End If

  ' Compose an e-mail message
  objMail.FromAddress = "me@gmail.com"
  objMail.FromName = "My Name"
  objMail.Subject = "Hi !"
  objMail.BodyPlainText = "Hello, How are you doing ?"
  objMail.BodyHtml = "<html><body><h2>Hello</h2><p>How are you doing ?</p></body></html>"
  objMail.AddTo "someone@example.com", "Someone"

  ' Send the e-mail
  objSmtp.Send objMail
  If objSmtp.LastError <> 0 Then
    WScript.Echo "Error: " & objSmtp.GetErrorDescription(objSmtp.LastError)    
  End If

  ' Disconnect from the server
  objSmtp.Disconnect
  WScript.Echo "Done !"

More samples

Samples are available for: C# .NET, Visual Basic .NET, Visual C/C++, VBA, ASP, ASP .NET, Java, Javascript, PHP, HTML, ColdFusion, Delphi, C++ Builder and more.

On ftp.activexperts-labs.com, you can find many Mobile Messaging Toolkit samples. Samples are also part of the Mobile Messaging Toolkit installation.