Private Sub Button1_Click
Dim mailc As MailComposer
If mailc.CanSendMail Then
Msgbox("E' possibile inviare email","OK")
Dim PageMail As Page
PageMail.Initialize("PageMail")
mailc.Initialize("mailc")
mailc.SetToRecipients(Array("hello@example.com", "world@example.com"))
mailc.SetSubject("This is the subject")
mailc.SetBody("This is the <b>body</b>.", True)
'create a file and add it as an attachment
File.WriteString(File.DirTemp, "1.txt", "hello world")
mailc.AddAttachment(File.DirTemp, "1.txt", "text/plain")
mailc.Show(PageMail)
Else
Msgbox("Non è possibile inviare email","KO")
End If
End Sub