Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component

Index of Chilkat Blog Posts

December 21, 2006

iPowerWeb SMTP Send Mail with POP-before-SMTP Authentication

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
' 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 = ""
mailman.PopUsername = ""
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 = ""
email.AddTo "Chilkat",""
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 = ""
success = mailman.SendEmail(email)
mailman.SaveLastError "smtpSendInfo.txt"

Privacy Statement. Copyright 2000-2011 Chilkat Software, Inc. All rights reserved.
Send feedback to

Components for Microsoft Windows XP, 2000, 2003 Server, Vista, Windows 7, and Windows 95/98/NT4.