Free Support Forum - aspose.com

Email sent confirmation

Hello,

Please could you give me a VB.NET example of how to test if an email has been sent successfully.


Thanks in advance,

Will

Sub Main()
Dim pm As New Aspose.Email.ProgressMonitor
Dim smtp As New Aspose.Email.SmtpAccount("127.0.0.1")
AddHandler pm.MessageSent, AddressOf OnMessageSent
Dim msg As New Aspose.Email.Message
msg.Send(smtp, pm)
End Sub

Private Sub OnMessageSent(ByVal sender As Object, ByVal e As Aspose.Common.Events.EventArgs)
'get the message intance just sent
Dim msg As Aspose.Email.Message = CType(e.RelatedObject, Aspose.Email.Message)

'get the address from the msg
Dim address As Aspose.Email.Address()
address = msg.GetAddresses(Aspose.Email.Address.Type.To)
End Sub

How to validate an email address using aspose.email