.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Modify Subject line of Notification e-mails sent by Database Mail

Posted By:      Posted Date: August 28, 2010    Points: 0   Category :Sql Server
Hello All, I am using database mail for SQL Server Agent Job notification.  It is working just great. However the e-mails that I receive have a specific format of subject line as below. SQL Server Job System: 'TEST' completed on \\Server_Name I wanted to see if I can modify this to send e-mails with this subject line. SQL Server Job System: 'TEST' completed on <Server_Name> Is this possible?  If so can someone help me with the steps? Thanks.

View Complete Post

More Related Resource Links

SQL Agent Job Notification - Database Mail problem

I'm a little stumped. Have setup database mail on SQL Server 2008 (SP1 x64) and its working fine except when its supposed to send out a SQL Agent job notification.
I've enabled database mail on SQL Agent and have specified a profile, but when it tries to send an email on agent job completion it errors with "NOTE: Failed to notify '<operator>' via email."
Can anybody help?

How to modify Send E-Mail subject ("Welcome to the SharePoint group") in People and Groups?


Hi All,


I am using WSS 3.0 in our application. Whenever user is added to the SharePoint Group using People and Groups page, user will be alerted using Send E-Mail option. We want to modify the subject “Welcome to the SharePoint group: Portal Visitors for site: Home”. I found that I can modify AclInv.aspx to modify the subject.


Could you please tell me is there any other way to change this text since modifying Layout pages are not recommended in our environment?


Thanks in advance.


SSIS Expression to send email with dataset on the Mail Subject line.



I have a task - I need to email total number of products sold on the subject line of the mail task.

I have Execute SQL task process like select count(*) from tablename. Then I need to Mail the result set like "Total products sold September 2010 : 15000" on teh subject line.

I created a variable bit i dont know how to assign it on the subject line of the Send Mail Task.

I would really appreciate if you can guide me.

Thanks for your help.


Database mail configured, but mails not getting send?


I've configured Database mail, but mails are not getting sent. Checked BOL & various blogs and forums, I'm performing correct steps, using correct smtp server name & port.


DM mail log says: 

The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 19 (2010-10-22T07:24:21). Exception Message: Could not connect to mail server. (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond <IP_ADD>:25).


On restarting SQL Agent, log says:

[355] The mail system failed to initialize; check configuration settings

[260] Unable to start mail session (reason: Microsoft.SqlServer.Management.SqlIMail.Server.Common.BaseException: Mail configuration information could not be read from the database. ---> System.Data.SqlClient.SqlException: profile name is not valid

   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)

   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)

   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStre)


SQL and Outlook: Enable Database Access and Updates Through Exchange and Any E-mail Client


Using Microsoft technologies, you can insert, edit, query, and delete database entries using any e-mail client such as Hotmail, Outlook, Yahoo, or even WAP phone. While e-mail is certainly a powerful and widely used tool, it is usually not integrated with an application for performing any tasks other than sending reminders. The application scenario described here, an e-mail-based SQL update program, uses a simple data model; however, this solution will apply to any data model that you are working with. It will also eliminate the need for complex n-tier Internet applications and serves as a low maintenance solution for providing data access.

Alok Mehta and Daniel Williams

MSDN Magazine January 2002

.net 3.5 in conjunction with CRM 4.0 email router adding code to subject line of emails causing spam

We use CRM 4.0, which is using .net framework 3.5 SP 1.  Emails sent out of CRM go through and email router and the subject line of these emails is getting "=?us-ascii?Q? added to the beginning of the subject line and "?= added to the end of the subject line. This is causing a large amount of our emails getting spammed. I was told by the CRM support that this is an issue with .net 3.5 and won't be fixed until .net 4.0, which CRM won't support for another year.  Is there not a .net 3.5 patch that can address this?

getting an e-mail notification when a transactional replication stucks

Hi all, I've SQL Server 2005 and a transactional replication scenario with one puplisher and 11 subscribers. Sometimes one of the subscriptions fails and a manual operation is required. Is there a way to get an e-mail notification whenever the replica fails or stucks or simply degrade its performances?

Database Mail configuring the maximum mail size (not attachment 'MaxFileSize')

Hi can anyone tell me if it's possible to configure the maximum size of an email when using database mail?  I know it's possible to use sysmail_configure_sp to set 'MaxFileSize', I want to prevent an email being sent the size of the body of the email is very large. In my case the body is based on a query result set inserted as html. Thanks      

Database Mail error

Hello I am new to SQL Server 2008. I am upgrading from 2000 to 2008 and currently working on Database Mail. I can send a test mail to say an email address like abc@xyz.com If i create an operator with the above email address, I am getting this error (in Database Mail log) when i send a test mail to Operator.  Message The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 3 (2010-09-07T10:31:24). Exception Message: Cannot send mails to mail server. (A recipient must be specified.). ) Any idea why Database Mail is able to send email when email address is specified and fails to send email to the same address when used in operator? Thank You, V

Mail data is truncated in Database mail

I have sent mail using Database mail...But I am getting only part of data in mail... The mail size remaining same. 8kb Is there is any limitation on mail size???Cheers...vaibhav

Help me modify regex code, only one line.

I have this code Dim parts As New List(Of String)(Regex.Split(RichTextBox2.Text, "~\d")) That splits lines in this format into parts: ~1Hello~2~3Bye~4~5Morning~6 So if I do MsgBox(parts(5)), it will show me "Morning". ------------------------------------------------------------------------ I want to do the exact same thing, but now my my line is arranged like this: Hello, Bye, Morning,   

Database Mail Error Logs


I am New To Work With C#.I need To Retrieve The All Error Log In SQL Server.I Had Done All The Logs Except Database Mail Error Log. I need an An Help for How To Retrieving The Database Mail Error Log through C# Coding.



Getting Error in Database Mail in SQL 2008




I have configured Database Mail using sp_send_dbmail in SQL 2008. It was working fine but then it suddenly stops working


I tried to send a test e-mail from the Database Mail, and I got the following error message:


Getting below error:

Mail not queued. Database Mail is stopped. Use sysmail_start_sp to start Database Mail. (Microsoft SQL Server, Error: 14641)


i want to create sharepoint 2007 workflow with E-mail notification in sharepoint designer ?


i want to create sharepoint 2007 workflow with E-mail notificationin sharepoint Designer .

my Workflow Scenario is :


Step-1 employer send document for approval to manager .

step-2 When manager will approve or reject . status will send to the emloyer through mail.

step-3 when manager will approve than document is going for approval by main manager.

step-4 if approve or reject status will send it to employer and manager.


plz help me .. for this. how i create in sharepoint designer . plz send me any exmaple of this.



Changing the E-Mail Subject field in a Document Library


I am trying to use SharePoint Manager 2007 to change the Sealed attribute of the item to False, so that I can edit the E-Mail Subject field of items in an email enable library.  When I select False I get the error: "Operation is not valid due to the current state of the object.". 

Is there another way that I can change this attribute to False?

Database Mail - How to clear queue list ?


Hi Experts,


i had a job on my client database which is running every 3 minutes to send out all my mail item list using Database Mail.

This job will automatically send out email which is retrieve from one of my table (DocumentQueue).

So whenever user click "Email" button on my system, system will add record on my table (DocumentQueue)

and every 3 minutes my job will started to send out all email in DocumentQueue which is not being send.


What my problem is... the recipient on my table in the wrong format, ie: admin@google.com;stone.wu@g;

And this email is being send on 09:00.

It keeps sending email every 3 minutes...

on the 1st 10 minutes the errors on sysmail_log was : 

"The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2010-10-04T09:28:00). Exception Message: Cannot send mails to mail server. (The specified string is not in the form required for an e-mail address.). )"

and after 10 minutes the errors was :

"The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2010-10-04T12:42:00). Exception Message: Could not connect to mail server. (An operation on a socket could not be performed because the system lack

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend