From Xojo Documentation

Property (As EmailMessage() )
aSMTPSocket.Messages = newEmailMessage()Value
EmailMessage()Value = aSMTPSocket.Messages

Supported for all project types and targets.

The queue of messages that is waiting to be sent.


This is an array of which the 0th element is the next message to be sent. When a message is sent, it is removed from the queue and passed to the MessageSent event. To append a message to the queue, use the Append method. To remove a message, use the Remove method.

Sample Code

Send a simple email:

Dim mail As EmailMessage

// set up the socket
Socket1.Address = ""
Socket1.Port = 25

Socket1.UserName = "<username>"
Socket1.Password = "<password>"

// populate the email message
mail = New EmailMessage
mail.FromAddress = ""
mail.Subject = "My Subject"
mail.BodyPlainText = "Hello!"
mail.Headers.AppendHeader("X-Mailer","SMTP Test")

// send the email