MOTOBIT.COM - ASP upload, IIS utility Bulk export of email configuration from a database

Sample for EmailExport.Account.AccountName | Changes | Purchase | Download


This sample demonstrates work with IAF (Internet account file) format. It let's you export email account data feom database to configuration fole for Outlook or Outlook express.

Bulk export of email configuration from a database 
Option Explicit

'Create account exporter object
Dim Export
Set Export = CreateObject("EmailExport.Account")

'Set common properties - servers.
Export.SMTPServer = ""
Export.POP3Server = ""

'open connection and recordset with source data.
Dim Conn, RS
Set Conn = GetDBConn("F:\work\Market\DB\market.mdb")

'The source table contains name of the person, email and password
Set RS = Conn.Execute("Select person, email, password from Emails")

Do While Not rs.eof
	'Save private account properties
	Export.AccountName = "Mail-Domain, " & RS("email")
	Export.SMTPEmailAddress = RS("email")
	Export.SMTPDisplayName = RS("person")

	'The server uses Email as a POP3 Logon name 
	Export.POP3UserName = "" & RS("email")
	Export.POP3Password = "" & RS("password")

	'Save the IAF file.
	Export.SaveIAFFile Export.AccountName & ".IAF"


Function GetDBConn(MDBDatabase)
  Dim GlobalConn
    Set GlobalConn = CreateObject("ADODB.Connection")
    GlobalConn.Provider = "Microsoft.Jet.OLEDB.4.0" "Data Source=" & MDBDatabase
  Set GetDBConn = GlobalConn
End Function

Other links for the Bulk export of email configuration from a database sample


Export of email account settings to the .iaf file format.


Email Account configuration exporter is an ActiveX/COM library, which let's you work with Outlook and Outlook Express email account configuration in VB script/JScript and other programming languages (t-SQL, C++, VBA, php, c#, Delphi...). You can create POP3, IMAP and HTTP email configurations or NNTP news account and export them directly from the script. You can export all fields, including servers, SPA, user names, emails, passwords, etc.

© 1996 - 2009 Antonin Foller, Motobit Software | About, Contacts | e-mail:

Other Motobit links:   IISTracer, real-time IIS monitor   ASP file upload - upload files to ASP. 
ActiveX/VBSScript registry editor  ActiveX NT User account manager  Export MDB/DBF from ASP Active LogFile  Email export  ActiveX/ASP Scripting Dictionary object