Last post Jun 04, 2019 02:37 PM by PatriceSc
May 22, 2019 02:57 PM|jonnygareth30|LINK
I have a stored procedure which pulls records from multiple tables by using the clientID when the user signs into their system, the records pulled from the database are then made visible on their client on their portal, what I would now like to do is send
these records to the relevant users by using the clientID within the login table and the tables in which the data has been pulled from?
Any help would be greatly appreciated.
May 22, 2019 03:11 PM|PatriceSc|LINK
Not sure which kind of help you are looking for (as it seems you already know you could send emails direclty from SQL Server ?).
Are you looking for the https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-send-dbmail-transact-sql?view=sql-server-2017 stored
procedure ? It needs to be configured first (see the general "Database mail" link at the bottom of this page).
If it doesn't help please be more explicit about the very first problem you have when trying to do so (another option is still to send a mail from the web server).
Edit:: according to https://social.msdn.microsoft.com/Forums/sqlserver/en-US/cd59b9cc-21ea-4130-afd1-791124031ada/can-sql-server-express-send-emails?forum=sqlexpress it
seems it was not yet available in SQL Server Express 2014. Which version do you use ? If confirmed for later version your "best" option could be to send this mail from the web server.
Edit 2 : according to https://www.veryiz.com/2017/configure-sql-database-email/ it is available in SQL Server Express 2012 but you don't have a GUI for some steps (but it could be also
outdated now that we don't have any more a special version of SSMS for SQL Express).
May 28, 2019 12:52 PM|AddWeb Solution|LINK
Please Refer below link it will help you find out how will send email using MSSQL Express
Also Refer below link which give you step by step solutions
May 29, 2019 06:58 AM|Fei Han - MSFT|LINK
I have a stored procedure which pulls records from multiple tables by using the clientID when the user signs into their system, the records pulled from the database are then made visible on their client on their portal, what I would now like to do is send these
records to the relevant users by using the clientID within the login table and the tables in which the data has been pulled from?
According to your description, we can know that the your application would retrieve the data from database based on clientID and display the retrieved data on portal after user signed into the system, to send email to specific users, you can also achieve
it in your application logic, and which would be easy to implement complex and flexible sending email functionality. For example, you can execute/trigger a background task to send emails after you rendered portal with the returned data.
Jun 04, 2019 01:52 PM|jonnygareth30|LINK
Thank you all for your replies, unfortunately having followed some of the provided links emails are created by are then qued and never sent. I have been looking into Quartz and wondering if and how a stored procedure could be called and sent using the scheduling
with Quartz within ASP.NET C#?
Within the system I have built in email functions which run on button clicks.
Again many thanks for all your help and again any assistance is greatly appreciated.
Jun 04, 2019 02:37 PM|PatriceSc|LINK
For now it doesn't seems it would solve your problem anyway (Quartz is to schedule work but it seems your intent is still to call a SP that sends this mail ?)
IMO it is always bad to just try something else because what you tried first doesn't. Understand first if is supposed to work and understand why it doesn't ?
Which SQL Server Express version are you using ? You configured a SMTP server to which queued mails could be sent ? You won't be able to send mails with SQL Server alone. It needs to be configured to forward those mails to a mail server.