Emailing via SMTP relay

  • Would appreciate advice as to how I set up my SQL Server backend to send emails.

    As an example, I would like to add a line to my stored procedures to send a sales report to the recipient and originator.

    The Sales report would need to be made up of a number of fields.

    Our global email system is non standard (main frame) and my technical colleagues have no experience of SQL Server as we are 99% Oracle.

    After repeated nagging they have finally agreed that I can test sending emails from the SQL Server backend.

    They have given my servers the necessary permissions and tell me that all I now need to do is "to set up your SMTP client to relay mail via our server. The ADE relay is 'relay address'"

    What do I need to do on the Server to send emails?

    What would be the best way of creating the actual email?

  • This was removed by the editor as SPAM

  • Sqlmail will only work with mapi profile and you need email client installed (Outlook 2000 or greater) although I believe SQL2000 SP3 allows the use of Outlook Express. Otherwise you could use cdosys to send mail via SMTP server. There are scripts posted on this site that can help you or I can send you my version (sp_send_cdosysmail).

    Far away is close at hand in the images of elsewhere.
    Anon.

  • I searched for cdosys on this site and tried the scripts I found but none worked. I either got error messages or they worked but nothing happened.

    However searching using cdosys on the Internet eventually led me to http://www.sqldev.net/xp/xpsmtp.htm

    The extended procedure xp_smtp_sendmail worked first time and seems to provide enough functionality for me at this stage.

    However I would be very interested in receiving your script as I would like to understand this topic better.

    Thanks for pointing me in the right direction.

  • You can try MS version also


    * Noel

  • Hi StefanJ

    I needed to setup a similar SMTP for my shop also. Did you must have an SMTP server to forward the email from SQL Server? if so, what do you needed in order to forward the email (like an generic alias or account on SMTP server ?)

    Thanks

  • See Clinton's Stored proc for sending mail. I have tried it and unlike xp_smtp_sendmail (which is still good) Clinton's proc allows the results of queries to be emailed. See

    http://www.sqlservercentral.com/scripts/contributions/510.asp

    Edited by - fhanlon on 12/12/2003 1:38:50 PM

    Francis

  • Thanks for the further replies. I will explore these further.

    dam432, I did not need a user id - The guys in charge of our internal SMTP relay gave access rights to my Production and Development server IP addresses. Then it was just a case of ensuring that the FROM and TO addresses contained correctly formatted email addresses.

Viewing 8 posts - 1 through 7 (of 7 total)

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