The subscription mails are not getting. How to get subscription mail - subscription

The subscription mails are not getting from our DSpace repository... All other mails are getting (like mail to admin for approve a submitted item, mail when an item submitted is get approved, etc.)..
How to get subscription mail ??

Sending subscription notices requires a cron job or scheduled tasks (for Windows OS) for it to work. The command for that is: [dspace]\bin\dspace sub-daily. Then you should set a schedule for it to run (the recommended frequency is daily).

Related

Sent status database mail with gmail

I have a problem with Database mail, which we are currently trying to change accounts for a database mail with a gmail account.
The problem is when I try to send an email with the wrong email account, the sent_status is always "Sent" in the log.
whereas before, when we used local e-mail, always showed a failed status when we tried it with the wrong e-mail.
SQL Server will just trigger the mail through SMTP, But if you wanna track the delivery status then you should check on SMTP server, which has been used in Mail configuration.

Send an email to current user in SQL Server Agent job when job fails

I have a SQL Job where I want to send an email alert if job fails. I know that for this functionalty I have to Configure Database Mail and than Adjust the properties within the SQL Server Agent. This article gives pretty good detail http://www.sherweb.com/blog/how-to-set-up-database-mail-for-sql-server-job-failures/.
What I want is, instead of setting up an email address to particular user like person1#test.com, I want to send an email to current user. This way who ever logged in to database and runs the job receives the email on job failure.
As I see, there are two benefits of this approach,
i. One particular user won't get flooded with emails. ii. Who ever is running the job can know that job has failed.
For example,
If I set person1#test.com and person2 logs in than on job failure person1 will receive an email. I don't want that. Is there any way that I can do this in SQL Server Agent Job settings. If no than how can I achieve this?
Like SELECT SYSTEM_USER or SELECT SUSER_NAME() gives me current user and use that as outgoing email address.
I think you are confused, if one user will start the job manually then you use a STORE PROCEDURE and there you can get the connected user information.
But pgAgent will run the process automatic and run using the USER you setup on the job.

Testing sp_send_dbmail

Does anyone know if there is a way to setup sql server to send all mail to one specific email address rather than what has been passed into sp_send_dbmail?
I ask as I need to verify what is going to be sent on a system that has customer email addresses and I don't want to actually send the email but rather check the contents.
The customer occasionally go onto this system to test certain things out which may trigger emails. At the moment these email are not sent out to anyone as the system is not setup for mail. I want this to stay the same but instead send all these mails to an internal email address. I don't know all the code that sends emails as there are approx. 3000 stored procedures in this system.
I have been searching on-line but can only find how to setup email.
If you're just looking to verify what will be sent, you can query the msdb.dbo.sysmail_mailitems table:
SELECT *
FROM msdb.dbo.sysmail_mailitems
This table holds the recipients, subject, body, format, query, sent_date, from_address, reply_to, and some other fields. I also suspect, though I haven't test, that if you updated that table to a new recipient email address that you could send them to the one address as you've requested above.
1)You can check mail is started or not using GUI.
2)you check email sending using following command.
Select * from msdb.dbo.sysmail_sentitems order by last_mod_date desc
enter image description here
unable to relay in Exchange Server :- Launch Exchange Server Manager and move to Administrative Groups. Select Administrative Group Name then choose Server>Server Name. Now click on Protocols and Select SMTP.
Right-click on Default SMTP Virtual Server and select Properties
In Access tab, click on Relay>only the list below
Now check the checkbox “Allow all systems to successfully authenticate to relay regardless of the list above” and close. ....check with internal team for permission.

I have used the database mailing system to send the email. But i could not figure our whether the email is sent or not

I have used the database mailing system to send the email. But i could not figure our whether the email is sent or not.
Is there any system table in sql server 2008 to insert the log whether the mail is sent or not. I want the sent 'email date from' , 'email date to' and Email Sent to. And is there any field that stores the mail sent like 'yes' or 'no'
Take a look at this article here. There are several tables in the msdb (system database) that are useful for tracking outgoing email status. From the article:
The Database Mail external program logs activity and displays the log
through the Windows Application Event Log and the sysmail_event_log
view in the msdb database. To check the status of an e-mail message,
run a query against this view. E-mail messages have one of four
possible statuses: sent, unsent, retrying, and failed.
Further, you can track additional info about the failures if you set the logging level to verbose when you configured your server for database mail.

How can I write a query for notification request from application to Database?

This is my perivous question. about how to push the data from database instead of application pull data.
After went through the link and the documents I come to know that I need to write a query in application side for notification request then the DB will register my request in subscription and If there is any change in the DB it will check subscription, if the request is there it will send the message to the client.
This para is from the above mentioned link
Along with the query submitted for the notification, the client submits a service name
and a broker instance. Each notification subscription begins a Service Broker dialog
with this provided service and broker instance. When data is changed and the change
would affect the result of the submitted query result, a message is sent on this
dialog. By sending this message, the client is considered notified and the notification
subscription is removed. If client desires to be notified on further changes, is
supposed to subscribe again.
Now I don't know how to write a query in application side for notification request and I don't under stand submit a service and a broker instance from the above given para. I guess the service and broker instance needs to be created in application before query the database for notification request. If it is so how to create service and a broker instance?
I can check the DB server for subscription by select * from sys.dm_qn_subscriptions command. can anyone help me?
Probably you didn't understand answer to your previous question completely, so I will try to clarify some things:
I guess the service and broker instance needs to be created in
application before query the database for notification request. If it
is so how to create service and a broker instance?
Service broker is a component of SQL Server, you don't instance nor create it. You enable it - it is a SQL Server admin task to do it.
To create a new service you have to first create queue for it and a contract to have a way of communication. Then you create your service.
When you create your service, instancing, activation and other related operations are handled by the Service Broker.

Resources