Sql Server Express 2008r2 Send Email

dk04
dk04 used Ask the Experts™
on
I'm trying e-mail results of a query through sql server express 2008. Can someone walk me through with some simple code.

Thanks

Query:
USE IPC
SELECT *
FROM IPC.dbo.prhpost prh
WHERE prh.chkdate = '2010-10-08'
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Use This(Substitute the Profile_name with the DB Mail Profile you configured)
EXEC msdb.dbo.sp_send_dbmail
    @profile_name = 'AdventureWorks2008R2 Administrator',
    @recipients = 'danw@Adventure-Works.com',
    @query = 'SELECT *
FROM IPC.dbo.prhpost prh
WHERE prh.chkdate = ''2010-10-08''  ,
    @subject = 'Work Order Count',
    @attach_query_result_as_file = 1 ;

Author

Commented:
To my knowledge SQL Express does not have DB Mail.
I did not work with Express but I read here that it does and there is code too , to configure without Wizards for SQL Express
http://www.sqlservercentral.com/Forums/Topic774540-324-1.aspx#bm775770
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

Author

Commented:
Says Mail queued but nothing received.

Author

Commented:
I read it but it still did not get the e-mail to send. I was able to find some other code online that worked.
how about this link ? It has solution for your problem looks like
http://www.sqlservercentral.com/articles/SQL+Express+2008/71341/

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial