How does sql mail and VB work together?

  • HI. I have a vb developer trying to write vb code to send a message to the user when a particular function is performed and he tells me that the VB documentation refers to SQL MAIL and using an extended stored procedure. Can anybody explain to me how VB AND SQL MAIL work together. I'm thinking a simple VB message box will suffice if this is realtime.

    Thank you,

    juanita

  • I believe the developer is talking about xp_sendmail. It could be used by calling a stored procedure or if data is manipulated then by a trigger.

    If the procedure does not currently involve the SQL Server then I'd strongly suggest that the developer look into using the Outlook or CDO objects straight from Visual Basic.



    Everett Wilson
    ewilson10@yahoo.com

  • If the objective is to send an email from within your VB app when a particular function is called within the VB app, I'd be inclined to make use of a simple SMTP activex control. You might do a search on the Internet for VB and SMTP and OCX... you'd be suprised what turns up... add Free to the search and see what that gets you... but buyer beware on the free stuff. I've used OstroSoft's SMTP OCX and it worked just fine for me. http://www.ostrosoft.com/smtp.asp

    Dave Owen

    Teligence Communications Inc.

    Vancouver, BC Canada

  • I agree strongly. XP_Sendmail is a godsend within a stored proc, but you would have to have a really good reason (business or process) to convince me to use vb to attatch to sql server to send an e-mail (even if I was already attatched and had a list of addresses).

    Unless your kicking off a batch process to loop through records and send out e-mails (and it doesn't sound like you are) , I would say use the much more robust E-mail capabilities available outside of SQL.

    Keep the load away from the database.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply