Some web hosting companies and ISPs use POP-before-SMTP authentication.
This means that to send email using your web hoster’s SMTP server, you should first login to the POP3 server. This opens a short window of time where you may connect and send via SMTP without authentication. The iPowerWeb hosting company uses this method. This example demonstrates how to send via SMTP using an iPowerWeb SMTP server. The same method applies when using the Chilkat components in any language: C#, VB.NET, FoxPro, Delphi, Ruby, Perl, Python, Java, C++, VB6, ASP, etc.
set mailman = CreateObject("ChilkatMail2.ChilkatMailMan2")
' Demonstrates how to send email when your ISP or web hosting company
' uses POP-before-SMTP authentication. For example, this is how
' iPowerWeb.com does it:
' "iPower email is configured to authenticate using POP rather than SMTP. This means
' that our server verifies who you are based on the incoming mail server, your username,
' and password. When you check incoming mail, the server opens a gateway of 20 mins
' where it will allow you to send your mail out to your intended recipients.
' Should the 20 minutes pass, the server no longer recognizes who you are and will
' need to verify security again using the incoming mail server."
success = mailman.UnlockComponent("anything for 30-day trial")
' Logon to the POP3 server for POP-before-SMTP authentication.
mailman.MailHost = "mail.mydomain.com"
mailman.PopUsername = "chilkat@mydomain.com"
mailman.PopPassword = "myPassword"
n = mailman.CheckMail()
if (n < 0) then
' This means it failed...
end if
' Now we can create and send an email via SMTP without SMTP authentication.
set email = CreateObject("ChilkatMail2.ChilkatEmail2")
email.Subject = "test from Chilkat"
email.From = "chilkat@mydomain.com"
email.AddTo "Chilkat","support@chilkatsoft.com"
email.Body = "This is a test"
email.AddFileAttachment "numbers.txt"
email.AddFileAttachment "5Loggerhead_Turtle.jpg"
email.AddFileAttachment "IMG_2674.JPG
email.AddFileAttachment "hamlet.xml"
mailman.SmtpHost = "mail.mydomain.com"
success = mailman.SendEmail(email)
mailman.SaveLastError "smtpSendInfo.txt"