[Webinar] Streamline your web hosting managementRegister Today


Executed xp_sendmail, said mail sent, but nothing received.

Posted on 2007-10-16
Medium Priority
Last Modified: 2008-03-06
I am currently trying to run a basic command to send an email to myself based on a trigger.  The code is as following:

DECLARE @SQL varchar(8000)
FROM NewHandsetContentMappingLog
WHERE TimeChanged >= (GETDATE() - .05)'
EXEC xp_sendmail '(my email address, ommitted for privacy reasons)'
    ,@query = @SQL

Problem is, SQL tells me that "Mail Sent" but I receive no mail.  I've tried right clicking on "Database Mail" under Management and sending a test message.  This works perfectly.  Anyone have any ideas as to why the test message would work but the xp won't send???
Question by:kzsigo
LVL 16

Accepted Solution

SQL_SERVER_DBA earned 1500 total points
ID: 20087963
does this user have xp_cmdshell rights and are they enable via configuration manager?

Author Comment

ID: 20088247
I actually got this one working you guys, I found sp_send_dbmail  as a great alternative with even more options in sending out the email.. Thx for your help

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
In this article, we will show how to detach and attach a database and then show how to repair a corrupt database and attach it, If it has some errors. We will show how to detach and attach using SSMS or using T-SQL sentences.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question