Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(PowerBuilder) Verify Email RecipientsA way to possibly determine valid/invalid email addresses. I would recommend being very careful about doing this because your IP address may be flagged as a potential spammer by the mail server (because you are probing for valid/invalid email addresses). This Chilkat functionality existed for many years, before this kind of activity became a problem. The functionality remains only because it is useful for some to test with their own SMTP servers.
integer li_rc oleobject loo_Mailman oleobject loo_Email integer li_Success oleobject loo_BadAddrs integer i // This example requires the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. loo_Mailman = create oleobject // Use "Chilkat_9_5_0.MailMan" for versions of Chilkat < 10.0.0 li_rc = loo_Mailman.ConnectToNewObject("Chilkat.MailMan") if li_rc < 0 then destroy loo_Mailman MessageBox("Error","Connecting to COM object failed") return end if // SMTP connection settings... loo_Mailman.SmtpHost = "smtp.example.com" loo_Mailman.SmtpUsername = "MY_SMTP_USERNAME" loo_Mailman.SmtpPassword = "MY_SMTP_PASSWORD" loo_Mailman.SmtpSsl = 1 loo_Mailman.SmtpPort = 465 // Create a new email object loo_Email = create oleobject // Use "Chilkat_9_5_0.Email" for versions of Chilkat < 10.0.0 li_rc = loo_Email.ConnectToNewObject("Chilkat.Email") loo_Email.Subject = "This is a test" loo_Email.Body = "This is a test" loo_Email.From = "myemail@example.com" li_Success = loo_Email.AddTo("person1","person1@example.com") li_Success = loo_Email.AddTo("person2","person2@example.com") li_Success = loo_Email.AddTo("person3","person3@example.com") // The SMTP server smtp.example.com won't know anything about an email address @somewhere_else.com li_Success = loo_Email.AddTo("person3","person4@somewhere_else.com") // ... // Verify recipients. // **** See the warning about using this API method in the description above. // (An SMTP server only knows valid email address for its own domain. For example, // smtp.example.com *may* only know if person1@example.com is valid or invalid, but does // not know anything about the validity of email addresses having other domains.) loo_BadAddrs = create oleobject // Use "Chilkat_9_5_0.StringArray" for versions of Chilkat < 10.0.0 li_rc = loo_BadAddrs.ConnectToNewObject("Chilkat.StringArray") li_Success = loo_Mailman.VerifyRecips(loo_Email,loo_BadAddrs) if li_Success <> 1 then Write-Debug loo_Mailman.LastErrorText destroy loo_Mailman destroy loo_Email destroy loo_BadAddrs return end if i = 0 do while i < loo_BadAddrs.Count Write-Debug loo_BadAddrs.GetString(i) i = i + 1 loop Write-Debug "done." destroy loo_Mailman destroy loo_Email destroy loo_BadAddrs |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.