Database Mail

Hi, 
I did configuration of Database Mail and sent an test email and got the message.
My problem is I have SQL Server Agent Job that sends emails when the job is failed. I did not get the email when the job failed. Why?
Thanks.

Hello
Try sp_send_dbmail from SSMS first. If works then you must make sure that the agent is configure to use the proper database mail profile
https://msdn.microsoft.com/en-us/library/ms190307.aspx
https://msdn.microsoft.com/en-us/library/ms186358.aspx
Hope it helps
Regards
Javier Villegas |
@javier_vill | http://sql-javier-villegas.blogspot.com/
Please click "Propose As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you

Similar Messages

  • Database mail not sending no error messages

    SQL server 2008 R2
    Database mail was up and running until sometime last week.  It seemed to quit in the middle of a long list of emails.  We had network issues at this same time that might have contributed to the issue.
    Everything checks out ok today but I cannot send a test email.  I do not see any error messages or 'db mail starting up' messages in the log.
    I do see the Email in the sysmail_unsentitems view.  
    I do not receive any error messages.
    I tried setting up a secondary account and that did not make a differnce.
    I tried stopping the mail service with EXEC msdb.dbo.sysmail_start_sp  and the query never completes.  I canceled after > 5 minutes 
    I deleted many unsent and one retrying message from the queue.  I see those actions in the log. 
    Is there any thing else I can try?
    KD

    Have you worked through the troubleshooting steps in the following BOL Topic to validate that the external executable is activating, and the queue status is correctly returning RECEIVES_OCCURRING:
    http://msdn.microsoft.com/en-us/library/ms187540.aspx
    Also have you tried increasing your retry configuration parameters to handle the larger mail queue that you are sending through?
    Jonathan Kehayias | Senior Consultant,
    SQLSkills.com
    SQL Server MVP | Microsoft Certified Master: SQL Server 2008
    Feel free to contact me through
    My Blog or
    Twitter. Become a
    SQLskills Insider!
    Please click the Mark as Answer button if a post solves your problem!

  • Is there a way to control the number of concurrent SMTP connections on Database Mail?

    Las week Rackspace started controlling the number of concurrent SMTP connections and we are now getting the following message when we send as little as 15 messages at a time using Database Mail:
    Exception Message: Cannot send mails to mail server. (Service not available, closing transmission channel. The server response was: 4.7.0 smtp13.relay.dfw1a.emailsrvr.com Error: too many connections from IP xxx.xxx.xxx.xxx)
    We are using SQL Server 2005 and Windows 2003 and we have been doing this since 2006 with no problems
    Is there a way to control the number of concurrent SMTP connections used by Database Mail or the Database Mail external executable DatabaseMail90.exe?

    Hi rkohler,
    Usually, we can use the Database Mail Configuration Wizard or the Database Mail stored procedures to determine the server name and port number for the Simple Mail Transfer Protocol (SMTP) server . In the SMTP server points, we can set or increase the number
    of concurrent connections.
    There is similar issue about database email on SQL Server 2005, you can refer to the following post.
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/6bb7b600-f025-451b-898b-2caa29c10d4d/only-some-email-gets-sent-successfully-from-spsenddbmail-database-mail-on-sql-server-2005
    Thanks,
    Sofiya Li
    If you have any feedback on our support, please click here.
    Sofiya Li
    TechNet Community Support

  • Notify Operator Task not sending email, Database mail works fine, Added Profile to Agent

    SQL Server 2008 R2, Latest Updates. 
    I added a Service Broker that has Alerts and Notifications in it.  In adding the service broker I had to go into the Agent Properties, Alert System, enable mail Profile, enabled the failsafe operator, etc. 
    I get email Alerts from the Service Broker that I Installed. I get the test emails too.  On the Properties of the Agent Job, I can get an email of the Completion, success or failure of the Job itself. 
    If I create a Maintenance Plan, that all that is in it a a Notify Operator Task, set it up with the same users, I never get the emails. If I go into the Reporting and Logging an then sent a email of the Log of the Job, I get that just fine too.
    Microsoft(R) Server Maintenance Utility (Unicode) Version 10.50.2500
    Report was generated on "SQL".
    Maintenance Plan: TestEmail
    Duration: 00:00:00
    Status: Succeeded.
    Details:
    F Notify Operator - Success (SQL)
    Task start: 2014-06-02T08:45:07.
    Task end: 2014-06-02T08:45:07.
    Success
    This started AFTER I enable the Alert System, Enable Mail Profile. 
    The server has been rebooted a few times since this started happening, so its not because I have not restarted the Agent. 
    If I uncheck the Enable Mail Profile in the Agent Alert System, I still get the Job's Log, but not the email of the Completion, Success or Failure. 

    Hello,
    Currently, I cannot reproduce the issue on my test environment. It works well when I create a maintenance plan include the Notify Operator task. This task uses the sp_notify_operator stored procedure. Did you check the T-SQL statements
    of the task ? You can get the statements by check the "View T-SQL" on the
    Notify Operators Task dialog.
    Please refer to the following statement of using sp_notify_operator:
    EXEC dbo.sp_notify_operator
    @profile_name = N'profile_name', --If profilename is not specified, the default Database Mail profile is used.
    @name = N'operator_name',
    @subject = N'Test Notification',
    @body = N'This is a test of notification.' ;
    GO
    Regards,
    Fanny Liu
    If you have any feedback on our support, please click here. 
    Fanny Liu
    TechNet Community Support

  • Database mail configuration is not working with office365

    Hi there!
    I' looking for some help debugging a blocking error in our DEV environment.
    We're currently using Windows 2008 R2 Standard, with IIS 7.5 and MS SQL Server 2012 Standard.
    We're experiencing troubles while trying to use database mail in conjunction with Office365 SMTP.
    We've generated our self-signed certificate, via IIS, and configured SMTP Virtual Relay Server with local (machine-name) and remote domain, following a step-by-step tutorial from configureoffice365.com.
    We've also checked at the original MSDN tutorial, but it's been of little use (at least for us).
    We would like to use our Office365 SMTP server to send out notifications and we're currently using Office365 working credentials to try the SMTP authentication, but we're stuck with this error (x is used to hide sensible data):
    OutboundConnectionCommand [12/May/2014:13:35:08 +0100] "STARTTLS - SMTP" 0 8
    OutboundConnectionResponse [12/May/2014:13:35:08 +0100] "- -?220 2.0.0 SMTP server ready SMTP" 0 27
    OutboundConnectionCommand [12/May/2014:13:35:08 +0100] "EHLO -?SQLDEVxxxxx SMTP" 0 4
    OutboundConnectionResponse [12/May/2014:13:35:08 +0100] "- -?250-xxxxx.outlook.office365.com Hello [x.x.x.x] SMTP" 0 58
    OutboundConnectionCommand [12/May/2014:13:35:08 +0100] "AUTH - SMTP" 0 4
    OutboundConnectionResponse [12/May/2014:13:35:08 +0100] "- -?334 xxxxx SMTP" 0 16
    OutboundConnectionResponse [12/May/2014:13:35:14 +0100] "- -?535 5.7.3
    Authentication unsuccessful SMTP" 0 37
    Any idea or suggestion?
    Thank you.

    Hi giovannizuccaro,
    According to your description, when you configure database mail in your SQL Server Management Studio,
     Please note that you enter the server to send to as localhost and the email address as the email you have on the office 365 Exchange online for the same account you used to configure the delivery configuration of the local SMTP server. And
    you should choose anonymous authentication for SMTP authentication. Once finished the configuration, you can test the email sending, check if you are able to send emails to any external recipient using you Exchange online.
    For more information, there is detail about how to configure SQL Database mail so send emails using Office 365 (Exchange Online):
    http://blogs.msdn.com/b/momalek/archive/2013/02/25/how-to-configure-sql-database-mail-so-send-emails-using-office-365-exchange-online-a-walkthrough.aspx
    If there are still some errors, I recommend you post your error message on the Office 365 forums (https://community.office365.com/en-us/f/default.aspx ), It is appropriate and more experts
    will assist you.
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Database mail only works from SSMS not from a job

    I have a script that returns its results via DB mail. When I run it from SSMS I get email, when I run it from a job I don't get email
    Here is the error message from the DB mail log
    Message
    The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2014-09-23T10:12:29). Exception Message: Cannot send mails to mail server. (The operation has timed out.).
    I've already enabled mail in SQL server agent.
    1. Went into object-explorer, right-clicked on the SQL Server Agent, and selected properties.  Then
    went to the Alert System page, and enabled the mail profile for the server agent. (you may already have this).
    2. Then, went to "Database mail", right-clicked and selected "Configure
    Database mail."  Selected "Manage profile security" and made sure my profile was set to public. THEN, and this is the kicker, clicked on the "Default Profile" field and set it to "yes". 
    I'm using SQL server 2012 running on a Windows 7 system
    Suggstions?

    BOL: Configure SQL Server Agent Mail to Use Database Mail
    Using Database Mail with SQL Server Agent
    Look in Event Viewer & Agent log to find related messages.
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • Database Mail not working with SQL Server Agent

    I'm running SQL Server 2005 Standard edition 64 bit with SP2 on a 64 bit machine. 
    Database mail does not work with SQL Server Agent.  When I configure SQL Server Agent to use database mail the test email button is greyed out and inactive therefore I cannot send emails using operators or for jub success failure etc. 
    I've read that there was supposed to be a fix for this with SP1 but I have SP2 and still receive the same problem.  Please can somebody help as I do not wish to use SQL Mail as a work around due to this becomming redundant in future versions of SQL Server.
    Kind Regards

    The problems solved
    steps:
    1)we create a mail profile at at Managment->Database Mail ,of SQL Managment
    2)we set this account as "default" at Managment->Database Mail -> Configure Database Mail -> Manage profile security
    3)At tab "Alert System" of SQL Server Agent properties , we check the "Enable mail profile" , Mail System=Database Mail, Mail profile = "the profile we already create"
    4)we create a new operator at "Operators" of sql agent, where at "notification options" -> "Email name" we put the mail where we want to sent the agent the mails at failured job
    5)We go at a specific job, at tab "Notifications" ,we check the "email" check box and then we choose the operator we just create, at the text box next to check box.
    I hope not to forget something
    Thank You all for the help

  • Setup Database mail that connect with tcp/ip to the instance

    I want to setup database mail that connect to the named instance via a fixed TCP/IP port.
    This is a named instance that works with a fixed TCP/IP port
    Database mail works fine if shared memory is enabled.
    If it is disable I get the following log entry in the application log.
    Log Name:      Application
    Source:        DatabaseMail
    Date:          18/11/2014 20:56:05
    Event ID:      0
    Task Category: None
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:      Server.dom.be
    Description:
    1) Exception Information
    ===================
    Exception Type: Microsoft.SqlServer.Management.SqlIMail.Server.Common.BaseException
    Message: There was an error on the connection. Reason: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL
    Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified), connection parameters: Server Name: server\instance, Database Name: msdb
    Data: System.Collections.ListDictionaryInternal
    TargetSite: Void OpenConnection(Microsoft.SqlServer.Management.Common.SqlConnectionInfo)
    HelpLink: NULL
    Source: DatabaseMailEngine
    StackTrace Information
    ===================
       at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.ConnectionManager.OpenConnection(SqlConnectionInfo connectionInfo)
       at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.DataAccessAdapter.OpenConnection(String dbServerName, String dbName, String userName, String password, String appName, Int32 connectionTimeout)
       at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.DataAccessAdapter.OpenConnection(String dbServerName, String dbName, String userName, String password, Int32 connectionTimeout)
       at Microsoft.SqlServer.Management.SqlIMail.IMailProcess.QueueItemProcesser.ProcessQueueItems(String dbName, String dbServerName, Int32 lifetimeMinimumSec, LogLevel loggingLevel, Byte[] encryptionKey, Int32 connectionTimeout)
    Is there a way to change the connection parameters?
    PS the Browser Service is not running

    Hello,
    If the instance is a named instance, then SQL Server Browser service should be started to be able to connect to the instance
    using TCP/IP.
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • SQL Server 2005 Database Mail - Mail configuration information could not be read from the database.

    I'm trying to setup Database Mail and send a test message, but it's not working.
    I've done several step-by-steps and all and I can't get it to work. Also checked several posts in this forum but none helped. I think it used to work before (2 months ago) but we had to turn it off.
    I've enabled it in Surface Configuration, have tried recreating all profiles, restarted SQL Agent, checked version mismatch...
    I check the Database Mail and I get the following message:
    Log Database Mail (Database Mail Log)
    Log ID 152
    Process ID 7684
    Last Modified 3/14/2013 6:49:58 PM
    Last Modified By SPEEDLING\sqlservice
    Message
    1) Exception Information
    ===================
    Exception Type: Microsoft.SqlServer.Management.SqlIMail.Server.Common.BaseException
    Message: Mail configuration information could not be read from the database.
    Data: System.Collections.ListDictionaryInternal
    TargetSite: Microsoft.SqlServer.Management.SqlIMail.Server.Objects.Account GetAccount(Int32)
    HelpLink: NULL
    Source: DatabaseMailEngine
    StackTrace Information
    ===================
       at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.DataAccessAdapter.GetAccount(Int32 accountID)
       at Microsoft.SqlServer.Management.SqlIMail.Server.Controller.CommandFactory.CreateSendMailCommand(DBSession dbSession)
       at Microsoft.SqlServer.Management.SqlIMail.Server.Controller.CommandRunner.Run(DBSession db)
       at Microsoft.SqlServer.Management.SqlIMail.IMailProcess.ThreadCallBack.MailOperation(Object o)
    2) Exception Information
    ===================
    Exception Type: System.IndexOutOfRangeException
    Message: timeout
    Data: System.Collections.ListDictionaryInternal
    TargetSite: Int32 GetOrdinal(System.String)
    HelpLink: NULL
    Source: System.Data
    StackTrace Information
    ===================
       at System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName)
       at System.Data.SqlClient.SqlDataReader.GetOrdinal(String name)
       at System.Data.SqlClient.SqlDataReader.get_Item(String name)
       at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.DataAccessAdapter.GetAccount(Int32 accountID)

    I'm trying to setup Database Mail and send a test message, but it's not working.
    I've done several step-by-steps and all and I can't get it to work. Also checked several posts in this forum but none helped. I think it used to work before (2 months ago) but we had to turn it off.
    I've enabled it in Surface Configuration, have tried recreating all profiles, restarted SQL Agent, checked version mismatch...
    I check the Database Mail and I get the following message:
    Log
    Database Mail (Database Mail Log)
    Log ID
    152
    Process ID
    7684
    Last Modified
    3/14/2013 6:49:58 PM
    Last Modified By
    SPEEDLING\sqlservice
    Message
    1) Exception Information
    ===================
    Exception Type: Microsoft.SqlServer.Management.SqlIMail.Server.Common.BaseException
    Message: Mail configuration information could not be read from the database.
    Data: System.Collections.ListDictionaryInternal
    TargetSite: Microsoft.SqlServer.Management.SqlIMail.Server.Objects.Account GetAccount(Int32)
    HelpLink: NULL
    Source: DatabaseMailEngine
    StackTrace Information
    ===================
       at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.DataAccessAdapter.GetAccount(Int32 accountID)
       at Microsoft.SqlServer.Management.SqlIMail.Server.Controller.CommandFactory.CreateSendMailCommand(DBSession
    dbSession)
       at Microsoft.SqlServer.Management.SqlIMail.Server.Controller.CommandRunner.Run(DBSession db)
       at Microsoft.SqlServer.Management.SqlIMail.IMailProcess.ThreadCallBack.MailOperation(Object o)
    2) Exception Information
    ===================
    Exception Type: System.IndexOutOfRangeException
    Message: timeout
    Data: System.Collections.ListDictionaryInternal
    TargetSite: Int32 GetOrdinal(System.String)
    HelpLink: NULL
    Source: System.Data
    StackTrace Information
    ===================
       at System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName)
       at System.Data.SqlClient.SqlDataReader.GetOrdinal(String name)
       at System.Data.SqlClient.SqlDataReader.get_Item(String name)
       at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.DataAccessAdapter.GetAccount(Int32 accountID)

  • SQL Server 2008 Database Mail Failure

    I am currently using SQL Server 2008.  I have database mail setup and it was working for a while without any issues.  However, now we are getting the following message anytime it trys to send an email with a domain address other than our own.
    The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 4 (2010-07-21T15:21:58). Exception Message: Cannot send mails to mail server. (The operation has timed out.). )
    The emails have been setup and working since last year up until June 30th.  I have made sure that the server name for the email server is correct.  Ports 25, 110, and 443 are open on the email server and I setup the database mail to use port 25.
    The sever name is webmail.somecompanyname.com
    I tested on the server that I could telnet to the mail server and I get the response back from the server that says ready.
    I tested sending an email to my work address by right clicking database mail and send test e-mail.  When I send it to my work email it works fine (myname.somecompany.com)
    When I do the same test only sending it to my personal comcast account I get the error message in the
    sysmail_faileditems.
    Can anyone help shed some light on other possible issues that might be causing this to fail now?
    Any help is greatly appreciated.
    Thanks in advance.

    My issues with the email might be fixed now.  I will be keeping an eye on it today.
    It turns out that we have 2 IPs for the 2 different internet providers that we have for our company.
    In the
    On Mail server > Exchange Server Manager > SMTP Connector Properties
     > Access Properties > Access Tab > Relay button it had the ip address for one of the providers, but not for the comcast one that we just installed on June 30th.
    The network administrator added the ip for comcast to the location above and it seems to be working now.
    We will keep our fingers crossed.
    Thanks for all your suggestions.

  • SQL Server Agent Job And Database Mail - Error formatting query, probably invalid paramters

    We have a stored procedure that we are trying to call with a SQL Server Agent Job. The stored procedure calls Database Mail. This is SQL 2008. The execute task is simply:
    USE [Production]
    GO
    EXEC [dbo].[JOB_EMAIL_SCHEDULED_REPORTS]
    GO
    When the job runs, it is erroring out immediately, with the error:
    Execute as user: NT AUTHORITY\NETWORK SERVICE. Error formatting query, probably invalid paramters [SQLSTATE 42000] (Error 22050). The step failed.
    When we go into SQL Server Manager and just execute the SQL query, it works though. Something within the SQL Server Agent job,  and Database Mail is causing problems. Any ideas? Thanks.

    Justin,
    If you use SSMS then the procedure is executed under a different user when compared to running using a SQL Server Agent Job.
    Isolate the problem by running a SQL Server agent job that sends a mail. Also check if the NT Authority\Network Service account is
    in good standing. Look at the below thread with a similar problem that had an expired account.
    http://social.msdn.microsoft.com/Forums/en/sqltools/thread/bac7ecee-a156-4313-b532-ba15813a0700
    http://SankarReddy.com/

  • Why am I unable to Configure Database Mail?

    To Anyone who can help -- I am following the self-paced training kit for Microsoft SQL Server 2008 Implementation and Maintenance written by Mike Hotek and have entered the following code as requested:  ( Note that I have italicized the
    code & message )
    EXEC sp_configure ‘Database Mail XPs’,1
    GO
    RECONFIGURE WITH OVERRIDE
    GO 
    When I execute this code I get the following message:
    Msg 15123, Level 16, State 1, Procedure sp_configure, Line 51
    The configuration option 'Database Mail XPs' does not exist, or it may be an advanced option.
    Admittedly I am very new to SQL Server -- the only thing I can figure why this is not working is because I did not check the Reporting Services box when I installed the SQL Server
    2008 Enterprise software, as I was following the instructions as close as possible.  The other possibility is I downloaded a different database than what was asked, although I have no idea how that would affect my outcome.  Thank you to anyone
    who can help!
    Oh yeah, I don't know if this helps but I am running Windows Vista, w/ Pentium(R) Dual-Core CPU processor 2.50GHz
    & 4GB of RAM and it is a 64-bit system...  Thanks again!

    please try  this---
    ----- First run below script 
    EXEC sp_configure 'Show Advanced Options', 1
    RECONFIGURE
    WITH OVERRIDE
    go
    ------ then run below script
    EXEC
    sp_configure ‘Database Mail XPs’,1
    GO
    RECONFIGURE
    WITH OVERRIDE
    GO 
    http://uk.linkedin.com/in/ramjaddu

  • Msg 22051 Database Mail Attachment file is invalid

    Hello,
    I'm testing a trigger to output a text file and then attach it to an email in Database Mail. So far, I've gotten the correct text file to export to a TEMP folder, but when I try to attach it to database mail, I get the message below. I think it is a permissions
    problem with the TEMP directory, but I've tried adding some permissions, but nothing seems to work. The profile name is TFRONT_DBMAIL and the account name is Albert using Basic Authentication for the SMTP server. I think you have to add the SQL Server User
    Account or the Database Mail account to the permissions, but I can't seem to find the exact one to use. I have set up other triggers that use database mail that only send messages with no attachments and they work fine.
    Any help appreciated!
    Albert
    Msg 22051, Level 16, State 1, Line 0
    Attachment file "C:\TEMP\NTCDManifestInv135255.txt" is invalid.
    Albert S

    Hello, I moved the temp file here:
    DECLARE
    @PathVARCHAR(200)='C:\Users\MSSQLSERVER\Temp\'
    SQL Server service account (MSSQLSERVER) has full access to that folder. Still getting this
    message:
    Msg 22051, Level 16, State 1, Line 0
    Attachment file "C:\Users\MSSQLSERVER\Temp\NTCDManifestInv135255.txt" is invalid.
    The file is created and it is in the Temp directory. It just won't attach. Thank you
    for any help! Below is the full statement.
    Albert
    DECLARE @CustomerID varchar(10) = 'NTCD'
    DECLARE @EmailBody varchar(1000)
    DECLARE @CustomerName varchar(50)
    DECLARE @InvoiceNo VARCHAR(6) = '135255'
    DECLARE @ManifestName VARCHAR(11) = 'ManifestInv'
    DECLARE @Extension VARCHAR(4) = '.txt'
    DECLARE @FullName VARCHAR(100)
    DECLARE @BCP VARCHAR(8000)
    DECLARE @Path VARCHAR(200) = 'C:\Users\MSSQLSERVER\Temp\'
    SET @FullName = char(34) + @Path + @CustomerID + @ManifestName + CAST(@InvoiceNo as VARCHAR) + @Extension + char(34)
    SET @BCP = 'bcp "SELECT char(34)+ComposerAuthor+char(34), char(34)+Title+char(34), char(34)+(ISNULL([Place],char(32))+char(32)+char(58)+char(32) + [Publisher]+char(44)+char(32) + [Copyright])+char(34) AS PlacePubDate, char(36)+CAST([ExtPrice] AS varchar), char(34)+ScoreFormat+char(34) FROM tfront.dbo.tblCustInvItems INNER JOIN tfront.dbo.tblInventory on tfront.dbo.tblCustInvItems.InventoryID = tfront.dbo.tblInventory.ID WHERE InvoiceNo = ' + @InvoiceNo + '" queryout '+ @FullName + ' -T -c -t\t -S'
    EXEC master..xp_cmdshell @BCP
    SET @EmailBody = 'The Account ' + @CustomerID + ' was billed today.' + Char(13) + 'A text manifest was sent.'
    EXEC msdb.dbo.sp_send_dbmail
    @profile_name = 'TFRONT_DBMail',
    @recipients = '[email protected]',
    @body = @EmailBody,
    @subject = 'TFront Database Auto Email',
    @file_attachments= @FullName;
    Albert S

  • Database mail configuration

    hi, 
      please tell how to configure database mail through smtp, can i configure it with hot mail account and what server name i should give, if i configure with hot mail.

    Hi,
    Refer below links.
    Setting up SQL Server Database Mail with gmail
    Setting up Database Mail to use Gmail account for Presentations
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    Praveen Dsa | MCITP - Database Administrator 2008 |
    My Blog | My Page

  • SQL Agent Job Notification - Database Mail problem

    Hi
    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?
    Thanks

     Hi Webdawg, 
      As suggested above, try these steps.
     1. Try  test email first, this can be by done (right click on database mail under mangement folder). prior to that you should already have a profile configured to send the emails and make sure you got the right SMTP server and  do not block
    port 25.
    2.If test is succeeds, enable mail option under sql server agent properties and select 'database mail' and corresponding profile.Add the reciepents email to the operators under sql server agent(check the enabled option here). Restart the SQL sever
    here.
    3. Create your sql job and in the notifcations section you should see email option and should have the operator email you configured above.
    Try it out. let us know. Hope it helps.
    If the test succeeds and still you did not get the email from sql job, check the database mail log and check whether it is being queued. let us know. 
    Please mark as 'Answer', if the solution solves your problem.

  • Database mail queue stays INACTIVE

    Hello
    I tried for hours to get my notifications working, without success, on SQL Server 2008R2 Web Edition 64b
    I send mail with the test :
    USE msdbGOEXEC sp_send_dbmail @profile_name='ARRIERE',@recipients='[email protected]',@subject='Bonjour ',@body='Congrates Database Mail Received By you Successfully.'
    But this mail seems to be never sent.
    With:
    EXEC msdb.dbo.sysmail_help_queue_sp @queue_type = 'mail';
    The queue state is always INACTIVE, and length is growing everytime I send a email.
    I tried to restart the mail system some times :
    EXEC msdb.dbo.sysmail_stop_sp;
    EXEC msdb.dbo.sysmail_start_sp;
    The states goes RECEIVE OCURRING, but after some seconds and without intervention, it goes back to INACTIVE.
    I tried to rester SQL Agent, SQL Server, the server himself, but no luck.
    The broker is activated (SELECT is_broker_enabled FROM sys.databases WHERE name = 'msdb' ;)
    I disabled every firewall, antivirus and others (by the way, I can do "telnet smtp.domain.tld 25" and send a mail with telnet.
    With
    SELECT * FROM msdb.dbo.sysmail_allitems;
    I see all my mails with state "unsent".
    Nothing logged in Event Viewer, SQL Events, and in sysmail_event_log I only get "Activation successful".
    I configured the local IIS SMTP as a relay as said here : http://social.msdn.microsoft.com/Forums/en/sqldatabaseengine/thread/f9744284-a9b6-4bfb-81b9-c4833f282ad0 
    I cleaned the mails with:
    DECLARE @GETDATE datetime
    SET @GETDATE = GETDATE()
    EXECUTE msdb.dbo.sysmail_delete_mailitems_sp @sent_before = @GETDATE;
    GO
    => Nothing more.
    Can I do something more?
    Thans for your help.
    Regards

    X.Perignon,
    Please check these items:
    1. Checked the SQL Server agent alert sytem configuraion to understand if the Database
    mail is enable or not. Right click SQL Server agent -> properties -> Alert system.
    2. Run sp_configure, check Database mail is enabled. Sample is: Database
    Mail XPs 0 1 1 1
    3. Checked the SQL Server MSDB database for service broker as below:
    select is_broker_enabled,* from sys.databases
    4. Checked the status of the database mail and it is started.
    EXECUTE dbo.sysmail_help_status_sp
    If all above is already configured, please try to:
    1. Create a mail account (domain account) dedicated for DB Mail
    2. Change the SQL service account to the mail account
    Best Regards,
    Iric
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Maybe you are looking for

  • Mismatch of BP number.

    Hi My client system have  practice like initially BP is created in CRM, then it will be created in R/3 with same number. In ECC number range is external and in crm it is internal.  But in one case by mistakenly user created sold to in r/3 as 3333, th

  • How does REMOTE work?

    I understand that iPhone REMOTE controls your iTunes on your computer, Apple TV or Airiport Express. If Apple TV/or Express is connected to my stereo system I presume, it would control my in house speakers throughout my home... correct? Will the Remo

  • Creating "Editable" PDF documents??

    I was wondering if anyone knows of any great Mac software to create editable PDFs. I'm looking for good commercial software, although freeware is OK, but prefer tried and true software. Basically, I have some documents I want to add some fields to, a

  • Anyway to create an iPhoto book with text & no image on cover?

    Would like to create a book with text only on the cover and no image. The only options with text require an image as well and as a result the pdf preview shows the square designated for an image (when no image provided). Any help/suggestions apprecia

  • When a pop up appers on firefox advertising free Ipods and you check on it and you pick everything they ask for and you receive a confermation # how do you get

    A pop up came on firefox about winning a free Ipod you had to buy 2 gold 2 silver 4 platium which I did. I was sent a reward confirmed # nGwHN8a3NWSmCRYj2bpN but I never received the Ipod. Why do you let this kind of thing pop up on your site, if the