API example: Sending a message

This example shows how to send an email using the hMailServer COM API.

Sending a message

dim oMessage
Set oMessage = CreateObject("hMailServer.Message")
oMessage.From = "Me"
oMessage.FromAddress = "myaddress@mydomain.com"
oMessage.Subject = "Hi"
oMessage.AddRecipient "My friend", "myfriend@myfriend.com"
oMessage.Body = "This is the contents of the email."
oMessage.Save

Search documentation