Home   Buy Now   Products   Downloads   Support   Resellers   Contact   Site Map  
Home   Buy Now   Download   Support  
Email Component, SMTP Component, POP3 Component, IMAP Component, bulk mail

Home
Purchase
Upgrade
 
Products
Downloads
 
Support
 Samples
 KB
 Forum
 
Newsletter
 
Customers
 Current List
 Comments
 
Resellers
Jobs
Contact Us
 July 11, 2002  

Volume 1, Issue 1 

Page Navigator: << Back, 1, 2, 3, 4, 5, Next >>

The Samples

The following VB Script samples interface with an Access database that contains the e-mail addresses.  The second sample also interfaces with an XML file that contains the phrases typically found in bounced messages.  The downloadable code includes the source code shown below along with the Access and XML files.  The samples listed on this page vary slightly from the downloadable code, as the code below has been edited to fit the newsletter format.

SAMPLE 1: Constructing and sending the message...

In this sample, we will send a message with a friendly address in the From: header, and our bounce address specified as the reverse-path.  This example uses VB Script and the EasyMail SMTP object.  The The SMTP object contains a FromAddr property, and by default the SMTP object will use the value specified by this property for both the reverse-path and automatic creation of the From: header.  We will override this behavior by setting the OptionFlags property to 1 which turns off the automatic creation of the From: header.  We will then create the From: header ourselves with the AddCustomHeader() method. 

'To do: Set the following variables:
strLicenseKey = "Newsletter Sample/02V4BFDSFFDFSD62"
strMailServer="mail.yourdomain.com"
strBounceBoxDomain="yourdomain.com"
strFriendlyFromName="Joe Sender"
strFriendlyFromAddress="joe.sender@domain.com"
'End To Do

Dim objSMTP, Data, RS, nRetVal

'create EasyMail SMTP object and set basic properties
Set objSMTP = CreateObject("EasyMail.SMTP")
objSMTP.LicenseKey = strLicenseKey
objSMTP.MailServer = strMailServer
objSMTP.OptionFlags = 1
objSMTP.AddCustomHeader "From", _
           """" & strFriendlyFromName & """" &_
	    " <" & strFriendlyFromAddress & ">"
objSMTP.Subject = "Subject..."
objSMTP.BodyText = "Message text"

'setup database and select addresses.
'This sample uses a access database.
Set cnnData = CreateObject("ADODB.Connection")
strConnection = "DBQ=email_database.mdb" 
cnnData.Open "DRIVER=" &_
           "{Microsoft Access Driver (*.mdb)};" &_ 
            strConnection
Set RS = CreateObject("ADODB.RecordSet")
RS.Open "SELECT hard_bounces,id, name, address" &_
        " FROM email_table" &_
        " where hard_bounces < 2" &_
        " and soft_bounces < 4", cnnData, 1, 3"

'send to each address selected
Do While RS.EOF = False
   
  'encode record id in from address
  objSMTP.FromAddr = "bounce_" & RS("id") &_
                      "@" & strBounceBoxDomain
  objSMTP.AddRecipient RS("name"), RS("address"), 1
  nRetVal = objSMTP.Send
   
  'if the recipients address fails right
  'away then we mark it as a hard bounce now.
  If nRetVal = 8 Then
     RS("hard_bounces") = RS("hard_bounces") + 1
  End If
   
  'remove the recipients
  objSMTP.Clear 1
   
  RS.MoveNext
   
Loop
	
'free remaining resources
RS.Close
cnnData.Close

Page Navigator: << Back, 1, 2, 3, 4, 5, Next >>


In This Issue:

Learn how to use bounced messages to clean your address list. 

Plus:
Downloadable code to get you started right away


This Issue's Poll:

Have you tested the compatibility of your HTML e-mail with AOL?

Yes
No


Signup for Newsletter:

CRITICAL tips and tricks for e-mail developers


New at Quiksoft:

EasyMail Objects SSL Plug-in released

EasyMail .Net Edition now includes IMAP4 assembly


EasyMail .Net EditionEasyMail .Net Edition
Written in C# and engineered by the leader in e-mail development, EasyMail .Net Edition is the easiest and most reliable way to integrate full-featured e-mail functionality into your .Net apps. Read the comparison for more information.

Buy  Download   Info
 


Customer Comments

"That's the fastest response I ever got from any company"

"I think you have the BEST support I have ever received from any tech-ie company!!!!  I really like your online issue tracker. And quick response times, and knowledgeable people and great products!!"

Read More...


E-mail this newsletter to a friend or to yourself:

Unsubscribe...

Printer Friendly Version...

©2002 Quiksoft Corporation. All rights reserved. Unauthorized duplication or distribution prohibited. Quiksoft, EasyMail, EasyMail Objects, EasyMail .Net Edition, EasyMail Advanced API, EasyMail SMTP Express, and MailStore are trademarks of Quiksoft Corporation. Other trademarks mentioned are the property of their legal owner.
©2010 Quiksoft Corporation. All rights reserved. Terms of Use, Privacy Statement, Trademarks