Quicklinks
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:
The Smtp object is part of the ActiveXperts Mobile Messaging Toolkit. Overview of all Mobile Messaging Toolkit objects:
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 !"
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.