I use Thunderbird's ability to send email from the command line to send out emails. Use @CreateAProcess and piece together the command string using @CHR(32) (double quotes). It allows for attachments. Here's my Thunderbird subroutine:
// The Thunderbird() subroutine take four arguments (all as STR) in the order of SendAddress, Subject, Body and the Attachments.
// The subroutine allows for multiple address and attachments, so long as the inputs are string arrays.
// Also, this subroutine assumes that the default Thunderbird install directory is the same on all computers.
SUBROUTINE Thunderbird(vToAddress as String, vSubject as String, vBody as String, vAttachment as String)
var vCommand as String
var vLoop as Int
If vToAddress <> "" // Not a blank vToAddress value.
{
If @CountStringArray(vToAddress) = 1
{
vCommand = "to=" + vToAddress
}
Else // More than one address to be sent.
{
vCommand = "to='"
For vLoop = 1 to @CountStringArray(vToAddress)
vCommand = vCommand + @AccessStringArray(vToAddress, vLoop) + ","
Next
// Now remove the trailing ","
vCommand = @TrimStringRight(vCommand, ",")
// Now add the last "'".
vCommand = vCommand + "'"
}
}
If vSubject <> "" // Not a blank vSubject value.
{
vCommand = vCommand + "," + "subject=" + vSubject
}
If vBody <> ""
{
vCommand = vCommand + "," + "body=" + vBody
}
If vAttachment <> ""
{
If @CountStringArray(vAttachment) = 1
{
vCommand = vCommand + "," + "attachment=file:///" + vAttachment
}
Else
{
vCommand = vCommand + "," + "attachment='"
For vLoop = 1 to @CountStringArray(vAttachment)
vCommand = vCommand + "file:///" + @AccessStringArray(vAttachment, vLoop) + ","
Next
// Now remove the trailing ","
vCommand = @TrimStringRight(vCommand, ",")
// Now add the last "'"
vCommand = vCommand + "'"
}
}
// Add final quote marks to vCommand string.
vCommand = @Chr(34) + vCommand + @Chr(34)
CreateAProcess("C:\Program Files\Mozilla Thunderbird\thunderbird.exe -compose" + " " + vCommand)
END SUBROUTINE
Kinda ugly, but it works. This subroutine pops up the composing window in ThunderBird, so that my users can 'see' what they're doing and make last minute changes, etc. I've got a list of oft-used PDF sell sheets that my sales reps send out using this subroutine. If you're looking to set up a whole campaign of emails to hundreds of people then this probably won't work -- maybe look into ConstantContact's API? Or some other email marketing company API?