sending email attachments

I have a need to be able to print to pdf (done), I now need to be able, from within Xojo, have an email dialog to send the file to the client recipient. Ideas?

I have my code and it works

Dim Mail As New EmailMessage
dim file as emailAttachment
Dim SendTo,s As String
Dim i As Integer
Dim kk As String

eMailControl01=New eMailControl

SendTo=CompanyEmail
FrmPos.LabMsgText.Text=""

If System.Network.LookupIPAddress(“google.com”) <> “” and MaineMail.Trim <> “” Then

eMailControl01.Address ="smtp.gmail.com"
eMailControl01.Port = 587
eMailControl01.Username =MaineMail.Trim
eMailControl01.Password = MaineMailpass.Trim

// Connect To Server
eMailControl01.Secure = True
eMailControl01.ConnectionType = SSLSocket.TLSv1
eMailControl01.Connect()

// Populate Email Message
Mail.FromAddress =CompName
Mail.Subject =eNombre
Mail.BodyPlainText =eMensage
Mail.Headers.AppendHeader eLocate01,"GasPos v1.0"

if mAttachFile  <> "" then
  file = new emailAttachment
  file.ContentEncoding="UTF8"
  file.loadFromFile getFolderItem(mAttachFile)
  mail.attachments.append file
end if

'SendTo = txtSendNumber.Text + "@" + pmCarrier.RowTag(pmCarrier.ListIndex)
s = replaceAll(SendTo,",",chr(13))
s = replaceAll(s,chr(13)+chr(10),chr(13))
for i = 1 to countFields(s,chr(13))
  Mail.addRecipient trim(nthField(s,chr(13),i))
next

// Send Email
eMailControl01.Messages.Append Mail
eMailControl01.SendMail()

For v as Integer=0 to 1500
  
Next

Else

FrmPos.LabMsgText.Text="**********  No Internet **********"

End If

or use MBS CURL Plugin for emailing as an alternative.

Of course you need to make your own dialog for emailing.

what are the lines

For v as Integer=0 to 1500 Next
for ?

my guess is waiting until the mail has sent

but thats just going to suck up a tiny amount of CPU needlessly

waiting and polling until its sent would be more useful