all groups > sql server dts > september 2004 >
You're in the

sql server dts

group:

How to email from DTS to Lotus notes users



How to email from DTS to Lotus notes users karenmiddleol NO[at]SPAM yahoo.com
9/21/2004 4:56:17 AM
sql server dts: We are running Lotus Notes as our mail system. I want SQL Server to
send emails to Notes users can somebody please explain how to setup a
mail profile to send emails to Notes users.

Many Thanks
Re: How to email from DTS to Lotus notes users Peter A. Schott
9/21/2004 12:28:44 PM
I went to the SQLDev website and downloaded Gert Drapers' excellent SMTP
Sendmail extended proc and stored proc wrapper. Makes sending notices quite a
bit easier if you can use SMTP.

http://www.sqldev.net/xp/xpsmtp.htm
http://www.sqldev.net/xp/sp_smtp_sendmail.htm

I believe a lot of this work formed the basis for iMail in SQL2005 - it at
least gets away from the MAPI dependencies, but you lose the ability to send
the output of queries directly.

I've built some ActiveX steps that populate my ExecSQL task with the
appropriate parameters and attachments. It works really well for me.


I think that you'll find this works a little easier than Notes API calls as
well if you can get that internal SMTP server running.

-Pete

[quoted text, click to view]
Re: How to email from DTS to Lotus notes users Beema
9/21/2004 2:59:04 PM

[quoted text, click to view]


I have SQL "email" tables set up , in which a DTS or any other SQL system
can insert emails into - basically with a MsgTo, MsgSubject, MsgeBody type
structure.

I then have a front-end application which polls the tables for new emails,
opens a Notes session via the API calls (pasted below) and sends the mail
off.

It wasn't easy, and isn't robust, but it's chugging along...... I'd been
interested to find a simpler way to do it.

Ben


---------------------------------------------------------------------------
-- Notes API Calls which starts sessions, sends mails through Notes etc.
---------------------------------------------------------------------------

// Initiailises the VIM functions
PUBLIC FUNCTION LONG VIMInitialize () LIBRARY "VIM32.DLL"

// Terminates the VIM functions
FUNCTION LONG VIMTerminate () LIBRARY "VIM32.DLL"

// Gets session info
FUNCTION LONG VIMGetDefaultSessionInfo( &
int sizePath, &
Ref String psPathSpec, &
int sizeName, &
Ref String psName ) LIBRARY "VIM32.DLL"

FUNCTION LONG VIMQueryCapability( &
Long selType, &
int sizeData, &
ref any pData ) LIBRARY "VIM32.DLL"

// Opens a session
FUNCTION LONG VIMOpenSession( &
Ref String psPathSpec, &
Ref String psName, &
Ref String psPass, &
Long dwVersion, &
Long selCharSet, &
Ref long pSesion ) LIBRARY "VIM32.DLL"

// Close a session
FUNCTION LONG VIMCloseSession( long psesion ) LIBRARY "VIM32.DLL"

// Create a message
FUNCTION LONG VIMCreateMessage( &
long psesion, &
string psType, &
Ref Long pMensaje ) LIBRARY "VIM32.DLL"

// Close a message
FUNCTION LONG VIMCloseMessage (long pmsg) LIBRARY "VIM32.DLL"

// Send Message
FUNCTION LONG VIMSendMessage( &
Long mensaje, &
long pCallbackParam, &
long callback ) LIBRARY "VIM32.DLL"

// Adds recipient
FUNCTION LONG VIMSetMessageRecipient( &
Long mensaje, &
Long class, &
Ref str_vim_recipient pRecip ) LIBRARY "VIM32.DLL"

// Add body or attachment
FUNCTION LONG VIMSetMessageItem( &
Long mensaje, &
Long selClass, &
String psType, &
Long selFlags, &
String psName, &
Ref str_vim_bufffiledesc pDesc ) LIBRARY "VIM32.DLL"

// Set Subject, priority & other info
FUNCTION LONG VIMSetMessageHeader ( &
LONG pmsg, &
LONG VIMSELSUBJECT, &
Int size, &
Ref string subject ) LIBRARY "VIM32.DLL"

// Return Message Status
FUNCTION LONG VIMStatusText( long psesion, &
long pstatus, &
int wTextSize, &
Ref string pText, &
int wExtTextSize, &
Ref string pExtText ) LIBRARY "VIM32.DLL"

// Open Address Book
FUNCTION LONG VIMOpenAddressBook( long psesion, &
string psName, &
ref string pAddressBook ) LIBRARY "VIM32.DLL"

AddThis Social Bookmark Button