SQLServerCentral.com / SQL Server Newbies / SQL Server 7,2000 / xp_sendmail - empty subject / Latest PostsInstantForum.NET v99.99.99SQLServerCentral.comhttp://www.sqlservercentral.com/Forums/notifications@sqlservercentral.comFri, 09 Dec 2016 10:35:32 GMT20RE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspxSo,hv anyone find the root of the problem for this and get the solution? i wish to know where outlook caching also..appreciate if someone can share..Mon, 25 Jun 2012 08:40:52 GMTbhsimRE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspxI have the same problem, Were using Outlook 2003 and SQL server 2000.The mail is sending OK but the subject line remains blank? If the variable is specified or left blank the result is the same.Did you ever get a solution to this problem.Thanks for any helpKennyThu, 05 Jun 2008 09:26:12 GMTKendo-771548RE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspxI was facing the exact same issue and this fix WORKED! Thanks a lot.Thu, 03 Apr 2008 16:48:32 GMTmichathaRE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspxI have recently had this issue when migrating servers adn the caching was the fix. Thanks everyone.Sat, 08 Sep 2007 10:36:00 GMTJane Matheson-154829RE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspxwe all wish m$ products could work seamlesslyFri, 17 Feb 2006 03:03:00 GMTbleduRE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspxAhh, got it - don't know why I didn't see that - sorry about that.AND IT WORKS!So thank yo uvery much for all of you who read this and made suggestions, esp to Bledu & Danial.RgdsFri, 17 Feb 2006 02:56:00 GMTRupert WoodmanRE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspxTools ->Email Accounts ->View or Change Existing -> [Select your Account] ->Click Change -> and wala you should see it. its a checkbox.this is on outlook 2003Fri, 17 Feb 2006 02:50:00 GMTbleduRE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspxNope, not yet - been kind of busy. Will try the caching option first, but if that doesn't work, I'll try the SP.thanksFri, 17 Feb 2006 02:31:00 GMTRupert WoodmanRE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspxHi Daniel,Thanks for the suggestion.I've had a look at my outlook client and I can't find mention of caching - could you tell me where it is?many thanksFri, 17 Feb 2006 02:31:00 GMTRupert WoodmanRE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspxI have cached mode turned on, and I could not duplicate the error. Have you installed the service packs as yet?Fri, 17 Feb 2006 02:08:00 GMTbleduRE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspxAlso, after caching has been turned off, you should restart SQL Mail by executing xp_stopmail then xp_startmail.Thu, 16 Feb 2006 12:53:00 GMTDaniel ChoRE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspxI experienced the same problem on a new development machine of ours. The solution was to turn OFF caching on the outlook client. Also, it wasn't just the subject which was affected. Sending a query attachment was not working as well. Turning off the caching fixed both of our issues.Hope that helps.Thu, 16 Feb 2006 12:40:00 GMTDaniel ChoRE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspxThanks for doing all that Bledu - much appreciated.I'm coming to the conclusion that I'll have to apply a service pack and see what happens. I didn't really want to as it'll then mean I'll have to go through the acceptance process with the users before I can update the live server, which will take time etc, but I guess I have no real choice.RgdsThu, 16 Feb 2006 03:33:00 GMTRupert WoodmanRE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspxI have win xp with latest update, outlook 2003 and sql 2000 with service pack 4.i tried to setup with similar stuff like yours and it works fine.this removes the problem of you having to go to an earlier version of outlook.i can not duplicate your problem though. your settings work fine on my machine.why don't you try installing service pack 4 for sql server 2000, it might solve your problem.Thu, 16 Feb 2006 02:52:00 GMTbleduRE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspxHi Bledu,Thanks for your suggestion. I don't think you understood my problem fully.I can send an email, and for one user it works perfectly, another user, on the same machine, it sends an email with an empty subject line.I did a cut & paste of your code, just changing the email address, and it behaved as my current script - the subject line comes through as blank.RgdsThu, 16 Feb 2006 02:18:00 GMTRupert WoodmanRE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspxCan you try turning off caching on your outlook client?Wed, 15 Feb 2006 15:30:00 GMTDaniel ChoRE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspxDECLARE @To VARCHAR(500)DECLARE @MessageString VARCHAR(500)DECLARE @User1Email VARCHAR(500)DECLARE @Topic VARCHAR(200)SET @MessageString ='This script will send an email'SET @User1Email = 'someone@mars.com' -- use semi colon to seperate many email addressesSET @To = @User1EmailSET @Topic = 'Test SQL Send Email'EXEC Master..xp_sendmail @recipients = @To ,@message = @MessageString ,@subject = @TopicWed, 15 Feb 2006 11:28:00 GMTbleduRE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspxHi Balmukund,In Outlook 2003, I can see an option to change to use Word as the default editor, but as I don't have Word installed on the machine, this option is greyed out.I don't see how I can change to use notepad as the default mail editor - could you elucidate please?Many thanksWed, 15 Feb 2006 02:16:00 GMTRupert WoodmanRE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspxHi Mathew,I'll certainly look at xp_smtpmail. I've not seen the website you mention either, so I'll have a peruse around there at some later point.I've just spent a couple of minutes checking the permissions and I believe they're the same:login corpdom\xtest has a role of sysadmin, and database access to XTestThis is the same as corpdom\rupertwDatabase user corpdom\xtest has database role membership of public and db_ownerThis is the same as corpdom\rupertwImmediately after the xp_sendmail statement, @@error is 0, which makes me think it thinks it worked correctly.Thanks for your suggestions. I don't really want to resort to an extra program because it'll mean more to remember when it comes to deployment, but I may have to resort to it.RgdsWed, 15 Feb 2006 02:10:00 GMTRupert WoodmanRE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspxI appreciate any thoughts you may have Amit.I've tried both single and double quoutes, to no avail.Note: exactly the same command was used for both users, so I don't think it's a quoting issue.RgdsWed, 15 Feb 2006 01:56:00 GMTRupert WoodmanRE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspx<P>I saw this behaviour earlier, I changed the outlook default mail editor to Notepad and problem went off.</P><P>Please try changing outlook default mail editor and let me know the results.</P><P> </P>Wed, 15 Feb 2006 00:46:00 GMTBalmukund Lakhani-269523RE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspxRupert ..if you can't get xp_sendmail to run...try using xp_smtpmail . You can get it at http:///www.sqldev.net . I find it to be far more reliable than xp_sendmail. One more question..do you have DBO privs with your user on the database? One thing I've noticed is that this type of thing is usually associated with some kind of privs issue. Even if the step fails sometimes, an email will still be sent.If you trap the returned status after the step you can tell if the step actually failed.HTHTue, 14 Feb 2006 15:06:00 GMTMathew J KulangaraRE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspxCan you try with single quote around the subject line. I was just throwing point in dark. I never had this issue and I do not have a server with sp2.Tue, 14 Feb 2006 11:46:00 GMTAmit LohiaRE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspxSorry, I can see I wasn't explict. I am logged in as corpdom\xtest and the services are configured to start under user corpdom\xtest.rgdsTue, 14 Feb 2006 11:42:00 GMTRupert WoodmanRE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspx<P>I think (not sure) you should have sql agent and outlook to be configured with same user.</P>Tue, 14 Feb 2006 11:39:00 GMTAmit LohiaRE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspxHi Mathew,Thanks for the reply.The SQL I'm executing is exactly as above - literal text, so I don't see that it can be a permission issue.RgdsTue, 14 Feb 2006 10:37:00 GMTRupert WoodmanRE: xp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspx<P>If your @subject value is set via a process(ie from a table, view, function, or sp)..make sure the user has privs on this process.</P><P> </P><P>HTH</P>Tue, 14 Feb 2006 10:23:00 GMTMathew J Kulangaraxp_sendmail - empty subjecthttp://www.sqlservercentral.com/Forums/Topic258305-169-1.aspxHi,I am trying to send mail from SQL Server 2000 but when the email is delivered, the subject line is empty.I have looked through the forums here and found someone with the same problem which they fixed it by reverting to a previous version of Outlook. Unfortunately, I'm not in a position to be able to do that.I've also entered: sql server xp_sendmail subject into Google, and gone through the first 22 pages of results, but to no avail.Here is what I have done:I have a machine nwb-xtest-beta, running Windows XP Pro, with all OS updates, and logged in as "xtest".I am running SQL Server 2000, with SP2.I have installed Outlook 2003, installed all the updates available to it, configured a profile ("XTest") and sent and received email fine.I configured the MSSQLSERVER service to be started as user corpdom\xtest, and restarted the service.I went to Enterprise manager, Support Services, SQL Mail, and selected XTest from the list of profiles.I then went to Query Analyzer, and ran:EXEC xp_sendmail 'rupertw', @subject="test subject", @message="test message"The message was delivered, but with an empty subject line. There was no subject in the SMTP headers (i.e. there was nothing after Subject: ).I wondered if it was a problem which had been fixed with a later service pack, so I went to my machine - nwb-rupertw (so I could be sure that it was the application of the SP which had fixed it), running the same software, but configured everything as user "rupertw".Executing the same SQL statement worked, including a good subject line.I went back to nwb-xtest-beta and reconfigured everything using the "rupertw" id. Again, it all worked, including good subject line.No errors reported in event viewer.It would imply that there is a difference in how xp_sendmail sees the different users, tho I've been told that they're the same.Has anyone got a suggested solution to this problem?Many thanksRgdsRupertTue, 14 Feb 2006 10:18:00 GMTRupert Woodman