Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
Send Email with Progress Monitoring
Demonstrates how to use event callbacks to send email in Visual Basic 6.0 using the Chilkat email component. The callbacks include an abort flag which can be set to force the mail sending to abort. ' When using events, you must declare the mailman "withevents" Public WithEvents mailman As ChilkatMailMan2 Private Sub Command1_Click() mailman.SmtpHost = "smtp.comcast.net" Dim email As New ChilkatEmail2 email.Subject = "This is a test" email.From = "admin@chilkatsoft.com" email.AddTo "Support", "support@chilkatsoft.com" email.Body = "This is a test" email.AddFileAttachment "dude.gif" mailman.SendEmail email MsgBox mailman.LastErrorText End Sub Private Sub Form_Load() Set mailman = New ChilkatMailMan2 mailman.UnlockComponent "Anything for 30-day trial" ProgressBar1.Value = 0 End Sub ' This is the event callback that updates the progress bar with the percentage done. Private Sub mailman_SendPercentDone(ByVal percentDone As Long, abort As Long) ProgressBar1.Value = percentDone End Sub ' Abort check is called at intervals when too much time elapses between "percent done" updates. ' This would happen when sending large emails. Private Sub mailman_AbortCheck(abort As Long) ' Set abort = 1 if you wish to abort. End Sub
|
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.