SQL Server 2005 DbMail not sending - sql-server-2005

I have a SQL Server 2005 DB Mail profile set up on my server that successfully sends a test email. However, when I queue an email in the msdb.dbo.sysmail_mailitems table, it does not ever try to send it. The status of the item stays at 0 (unsent).
In the Database Mail Log, the following entries are shown:
event_type log_date description process_id mailitem_id account_id last_mod_date last_mod_user
0 2012-05-07 10:07:00.887 Activation successful. NULL NULL NULL 2012-05-07 10:07:00.887 sa
1 2012-05-07 10:07:06.323 DatabaseMail process is started 6504 NULL NULL 2012-05-07 10:07:06.323 NT AUTHORITY\SYSTEM
3 2012-05-07 10:07:07.213 Could not retrieve item from the queue. 6504 NULL NULL 2012-05-07 10:07:07.213 NT AUTHORITY\SYSTEM
1 2012-05-07 10:12:07.453 DatabaseMail process is shutting down 6504 NULL NULL 2012-05-07 10:12:07.453 NT AUTHORITY\SYSTEM
There are no exceptions in the windows event viewer. Can someone direct me to where I can find more info regarding the error? "Could not retrieve item from the queue." doesn't help me much.
Thanks

Related

Query NPS Radius SQL log for reject events

I'd like to have a SQL query to find only radius reject events (type=3). The previous row is also required to know the user name that was rejected.
Data looks like this:
id
timestamp
NPS_Svr
Packet_Type
Description
User-Computer
27949
1:25:46 PM
SVR1
2
Access Accept
NULL
27948
1:25:46 PM
SVR1
1
Access Request
user1
27947
1:25:36 PM
SVR1
3
Access REJECT
NULL
27946
1:25:36 PM
SVR1
1
Access Request
user1
27945
1:25:33 PM
SVR3
2
Access Accept
NULL
27944
1:25:33 PM
SVR3
1
Access Request
user2
27943
1:25:21 PM
SVR3
3
Access REJECT
NULL
27942
1:25:21 PM
SVR3
1
Access Request
user2
select *
from accounting_data
where packet_type=3
Returns the reject rows but I also need the previous row from the same NPS Server to know the user name that was rejected.
The server is MS SQL 2014.
As I understand previous row it's
according to sort order of id columns,
So I suggest to self join by id-1
SELECT main.*,past.user_computer FROM (
select m.*,RANK() OVER (PARTITION BY nps_svr ORDER BY id ) as RnKSer
from accounting_data m
) main left join (SELECT nps_svr,RnKSer-1 as PastRnKSer,user_computer
FROM (
select m.*,RANK() OVER (PARTITION BY nps_svr ORDER BY id ) as RnKSer
from
accounting_data m
) prev ) past on main.nps_svr=past.nps_svr and RnKSer=PastRnKSer
where packet_type=3
ORDER BY 1

Using SELECT ... FOR UPDATE to poll for a value change

I have a table that contains tasks and their status, akin to:
| task_id | task_status |
+---------+-------------+
| 71 | 1 |
| 85 | 3 |
| 110 | 2 |
Let's call the table TASKS.
Status is an enumerated value, for example:
= SCHEDULED
= RUNNING
= DONE
I need to poll this status to inform the user about a task he started. Currently, I'm just polling it on the server using a while loop, like this pseudocode:
status = old_status
while(timeout_not_expired and status==old_status) {
status = get_status("SELECT task_status FROM TASKS WHERE task_id=%1", task_id)
wait(check_interval)
}
return status
That's nasty, not only it spams the Oracle SQL server, it also spams our log of SQL queries.
So I did a bit of googling and found about SELECT ... FOR UPDATE. I tried to run this statement:
SELECT
task_status
FROM TASKS
WHERE task_id = 361
FOR UPDATE OF task_status
But it returns immediately. So the question:
Is this even what FOR UPDATE is for?
If yes, how do I get it to wait on the row with a timeout?
No, that isn't what that clause is for. From the documentation:
The FOR UPDATE clause lets you lock the selected rows so that other users cannot lock or update the rows until you end your transaction.
Your query selects the current status for that task and locks the row, essentially on the assumption that you plan to update it, and don't want anyone else to be able to change it between your select and subsequent update.
So after you perform that query, no-one else can update the status of that task until you commit or rollback - kind of the opposite of what you're trying to achieve.
You could look at alert or queueing mechanisms, but you might want to investigate continuous query notification, though it could be overkill for this.

Send email through procedure in PL SQL

I want to make a procedure through which I can send email to my team mail id.
actually there are number of procedures running daily in our system.So i want to send the status of each procedure means if procedure is getting success,failed or running.If the procedure is in running state i have to show the running time in that email.And also if the procedure is failed then i have to show the error message in that email.Actually one table is present in our database in which procedure
id,date,start_time,end_time,status,error
desc columns are there.I shared the details below.
proc id date start_time end_time status error desc
1 6/7/2017 7/5/2017 9:55:16 AM 7/6/2017 1:36:25 AM SUCCESS
2 6/28/2017 6/29/2017 8:30:02 AM 6/29/2017 2:20:15 PM FAIL -1555 - ORA-01555: snapshot too old: rollback segment number 334 with name "_SYSSMU334_1817651691$" too small
ORA-02063:
3 7/5/2017 7/6/2017 9:34:54 AM RUNNING
As i said i have to show all the 3 types of status in the email which is to be sent through procedure.kindly help me regarding this.

Bonita 7 - processes stop working when writing any attribute of any Business Data

I just installed Bonita and tried some starter example (so no changes on general configuration were made). My problem is that every time I try to write some attribute of any business variable is like if the process would stop.
I figured this out because if I try to set some default value in my business data (by editing them in the pool variables panel) the Portal doesn't even start, otherwise if I use a service task to set the attributes by operations and than I connect it to a human task, the process starts but the human task is never detected (like of the process would stop to the first task).
So I suppose something goes wrong when I write an attribute in any way and for any object (I've double-checked with object made by the VacationRequest example).
How can I fix that?
EDIT:
I'm posting log data for the case where I try to insert my inputs by an operation in a service task and than connecting this task to an human one (which is never displayed in the portal)
This is the Studio log:
!ENTRY org.bonitasoft.studio.engine 1 0 2015-12-11 16:19:22.615
!MESSAGE Attempt to login as helen.kelly
!ENTRY org.bonitasoft.studio.engine 1 0 2015-12-11 16:19:22.644
!MESSAGE Login successful.
!ENTRY org.bonitasoft.studio.engine 1 0 2015-12-11 16:19:23.164
!MESSAGE Building bar for process Pool (1.0 )...
!ENTRY org.bonitasoft.studio.engine 1 0 2015-12-11 16:19:24.398
!MESSAGE Build complete for process Pool (1.0 ).
!ENTRY org.bonitasoft.studio.engine 1 0 2015-12-11 16:19:24.407
!MESSAGE Attempt to login as helen.kelly
!ENTRY org.bonitasoft.studio.engine 1 0 2015-12-11 16:19:24.431
!MESSAGE Login successful.
!ENTRY org.bonitasoft.studio.engine 1 0 2015-12-11 16:19:25.138
!MESSAGE Attempt to login as helen.kelly
!ENTRY org.bonitasoft.studio.engine 1 0 2015-12-11 16:19:25.162
!MESSAGE Login successful.
!ENTRY org.bonitasoft.studio.engine 1 0 2015-12-11 16:19:25.195
!MESSAGE Attempt to login as helen.kelly
!ENTRY org.bonitasoft.studio.engine 1 0 2015-12-11 16:19:25.219
!MESSAGE Login successful.
!ENTRY org.bonitasoft.studio.engine 1 0 2015-12-11 16:19:25.314
!MESSAGE Attempt to login as helen.kelly
!ENTRY org.bonitasoft.studio.engine 1 0 2015-12-11 16:19:25.337
!MESSAGE Login successful.
This is the Engine log:
2015-12-11 16:19:22.686 +0100 org.bonitasoft.engine.api.impl.transaction.process.DisableProcess org.bonitasoft.engine.log.technical.TechnicalLoggerSLF4JImpl log
Informazioni: THREAD_ID=4392 | HOSTNAME=Light-PC | TENANT_ID=1 | The user <helen.kelly> has disabled process <Pool> in version <1.0> with id <8793400777422165775>
2015-12-11 16:19:23.131 +0100 org.bonitasoft.engine.api.impl.ProcessManagementAPIImplDelegate org.bonitasoft.engine.log.technical.TechnicalLoggerSLF4JImpl log
Informazioni: THREAD_ID=66 | HOSTNAME=Light-PC | TENANT_ID=1 | The user <walter.bates> has deleted process with id = <8793400777422165775>
2015-12-11 16:19:25.115 +0100 org.bonitasoft.engine.api.impl.ProcessAPIImpl org.bonitasoft.engine.log.technical.TechnicalLoggerSLF4JImpl log
Informazioni: THREAD_ID=4333 | HOSTNAME=Light-PC | TENANT_ID=1 | The user <helen.kelly> has installed process <Pool> in version <1.0> with id <7896310222649598842>
2015-12-11 16:19:25.174 +0100 org.bonitasoft.engine.api.impl.transaction.process.EnableProcess org.bonitasoft.engine.log.technical.TechnicalLoggerSLF4JImpl log
Informazioni: THREAD_ID=4333 | HOSTNAME=Light-PC | TENANT_ID=1 | The user <helen.kelly> has enabled process <Pool> in version <1.0> with id <7896310222649598842>
2015-12-11 16:19:25.282 +0100 org.bonitasoft.engine.api.impl.ProcessStarter org.bonitasoft.engine.log.technical.TechnicalLoggerSLF4JImpl log
Informazioni: THREAD_ID=4333 | HOSTNAME=Light-PC | TENANT_ID=1 | The user <helen.kelly> has started the process instance <26> of process <Pool> in version <1.0> and id <7896310222649598842>
2015-12-11 16:19:25.343 +0100 org.hibernate.engine.jdbc.spi.SqlExceptionHelper org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
WARN: SQL Error: 23502, SQLState: 23502
2015-12-11 16:19:25.344 +0100 org.hibernate.engine.jdbc.spi.SqlExceptionHelper org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
ERROR: NULL not allowed for column "DATAINGRESSOUE"; SQL statement:
insert into CITIZEN (persistenceId, DATAINGRESSOUE, DATAUSCITAUE, FINEVALIDITAVISTO, FINGERPRINT, GIORNISPESI, INIZIOVALIDITAVISTO, NAME, RPT, SURNAME, persistenceVersion) values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23502-170]
2015-12-11 16:19:25.349 +0100 org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork org.bonitasoft.engine.log.technical.TechnicalLoggerSLF4JImpl log
Grave: THREAD_ID=5005 | HOSTNAME=Light-PC | TENANT_ID=1 | The work [ExecuteFlowNodeWork: processInstanceId:26, flowNodeInstanceId: 44] failed. The failure will be handled.
2015-12-11 16:19:25.356 +0100 org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork org.bonitasoft.engine.log.technical.TechnicalLoggerSLF4JImpl log
Grave: THREAD_ID=5005 | HOSTNAME=Light-PC | TENANT_ID=1 | javax.persistence.PersistenceException : "org.hibernate.exception.ConstraintViolationException: could not execute statement"
javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387)
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1310)
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1316)
at org.hibernate.ejb.AbstractEntityManagerImpl.merge(AbstractEntityManagerImpl.java:898)
at org.bonitasoft.engine.business.data.impl.JPABusinessDataRepositoryImpl.merge(JPABusinessDataRepositoryImpl.java:259)
at org.bonitasoft.engine.operation.MergeEntityAction.execute(MergeEntityAction.java:41)
at org.bonitasoft.engine.operation.EntitiesActionsExecutor.executeAction(EntitiesActionsExecutor.java:42)
at org.bonitasoft.engine.operation.BusinessDataJavaMethodOperationExecutorStrategy.delegateBusinessValueForLeftOperand(BusinessDataJavaMethodOperationExecutorStrategy.java:64)
at org.bonitasoft.engine.operation.BusinessDataJavaMethodOperationExecutorStrategy.computeNewValueForLeftOperand(BusinessDataJavaMethodOperationExecutorStrategy.java:46)
at org.bonitasoft.engine.core.operation.impl.OperationServiceImpl.calculateRightOperandValue(OperationServiceImpl.java:122)
at org.bonitasoft.engine.core.operation.impl.OperationServiceImpl.executeOperators(OperationServiceImpl.java:105)
at org.bonitasoft.engine.core.operation.impl.OperationServiceImpl.execute(OperationServiceImpl.java:94)
at org.bonitasoft.engine.core.operation.impl.OperationServiceImpl.execute(OperationServiceImpl.java:81)
at org.bonitasoft.engine.execution.StateBehaviors.executeOperations(StateBehaviors.java:657)
at org.bonitasoft.engine.execution.state.ExecutingAutomaticActivityStateImpl.onEnterToOnFinish(ExecutingAutomaticActivityStateImpl.java:48)
at org.bonitasoft.engine.execution.state.FlowNodeStateWithConnectors.execute(FlowNodeStateWithConnectors.java:73)
at org.bonitasoft.engine.execution.state.FlowNodeStateWithConnectors.execute(FlowNodeStateWithConnectors.java:35)
at org.bonitasoft.engine.execution.FlowNodeExecutorImpl.executeState(FlowNodeExecutorImpl.java:128)
at org.bonitasoft.engine.execution.FlowNodeExecutorImpl.updateState(FlowNodeExecutorImpl.java:180)
at org.bonitasoft.engine.execution.FlowNodeExecutorImpl.stepForward(FlowNodeExecutorImpl.java:164)
at org.bonitasoft.engine.execution.FlowNodeExecutorImpl.executeFlowNode(FlowNodeExecutorImpl.java:315)
at org.bonitasoft.engine.execution.work.ExecuteFlowNodeWork.work(ExecuteFlowNodeWork.java:72)
at org.bonitasoft.engine.execution.work.TxBonitaWork$1.call(TxBonitaWork.java:48)
at org.bonitasoft.engine.execution.work.TxBonitaWork$1.call(TxBonitaWork.java:44)
at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.executeInTransaction(JTATransactionServiceImpl.java:316)
at org.bonitasoft.engine.execution.work.TxBonitaWork.work(TxBonitaWork.java:53)
at org.bonitasoft.engine.execution.work.LockProcessInstanceWork.work(LockProcessInstanceWork.java:79)
at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
at org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork.work(FailureHandlingBonitaWork.java:66)
at org.bonitasoft.engine.work.BonitaWork.run(BonitaWork.java:56)
at org.bonitasoft.engine.work.SequenceRunnableExecutor.innerRun(SequenceRunnableExecutor.java:47)
at org.bonitasoft.engine.work.BonitaRunnable.run(BonitaRunnable.java:35)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement
at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:129)
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:189)
at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:96)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:58)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2987)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3499)
at org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:81)
at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:395)
at org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:229)
at org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:209)
at org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:193)
at org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:321)
at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:286)
at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:192)
at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:125)
at org.hibernate.ejb.event.EJB3MergeEventListener.saveWithGeneratedId(EJB3MergeEventListener.java:71)
at org.hibernate.event.internal.DefaultMergeEventListener.saveTransientEntity(DefaultMergeEventListener.java:236)
at org.hibernate.event.internal.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:216)
at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:154)
at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:76)
at org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:833)
at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:817)
at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:821)
at org.hibernate.ejb.AbstractEntityManagerImpl.merge(AbstractEntityManagerImpl.java:889)
... 33 more
Caused by: org.h2.jdbc.JdbcSQLException: NULL not allowed for column "DATAINGRESSOUE"; SQL statement:
insert into CITIZEN (persistenceId, DATAINGRESSOUE, DATAUSCITAUE, FINEVALIDITAVISTO, FINGERPRINT, GIORNISPESI, INIZIOVALIDITAVISTO, NAME, RPT, SURNAME, persistenceVersion) values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23502-170]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
at org.h2.message.DbException.get(DbException.java:169)
at org.h2.message.DbException.get(DbException.java:146)
at org.h2.table.Column.validateConvertUpdateSequence(Column.java:293)
at org.h2.table.Table.validateConvertUpdateSequence(Table.java:689)
at org.h2.command.dml.Insert.insertRows(Insert.java:120)
at org.h2.command.dml.Insert.update(Insert.java:84)
at org.h2.command.CommandContainer.update(CommandContainer.java:75)
at org.h2.command.Command.executeUpdate(Command.java:230)
at org.h2.server.TcpServerThread.process(TcpServerThread.java:333)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:149)
at java.lang.Thread.run(Thread.java:744)
at org.h2.engine.SessionRemote.done(SessionRemote.java:568)
at org.h2.command.CommandRemote.executeUpdate(CommandRemote.java:181)
at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:156)
at org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:142)
at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at bitronix.tm.resource.jdbc.BaseProxyHandlerClass.invoke(BaseProxyHandlerClass.java:64)
at com.sun.proxy.$Proxy142.executeUpdate(Unknown Source)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:186)
... 55 more
Based on the Engine log content it seems that when you create a new entry for "CITIZEN" business variable you didn't specify any value (or specify a null value) for "DATAINGRESSOUE" attribute.
This attribute is probably mandatory, that would explain the error log message:
NULL not allowed for column "DATAINGRESSOUE";
You have two options here:
Edit your business data model to make this attribute optional. I would also recommend that when you publish your changes you check the option to reset existing data even if for such change it should not be mandatory.
Edit the default value Groovy script to make sure that a non-null value is provided for "DATAINGRESSOUE" attribute and all others mandatory attributes.

SQL server "Cannot send mails to mail server" "Failure sending mail"

I am using MS SQL Server 2008 R2 SP2 Express edition, 64 bit.
I do not have access to the Database Mail setup wizard, but the Binn directory contains DatabaseMail.exe (v10.50.16600.1) and DatabaseMailengine.dll.
I found several references to "Cannot send mails to mail server", but nothing useful with the annoyingly generic "Failure sending mail" message.
My specific question is where can I find out what that error message means/what causes it? If some kind soul would care to hazard a guess about what is going on, or not going on, I would appreciate it.
Setup info from the database follows:
EXECUTE sp_configure 'show advanced'
name minimum maximum config_value run_value
show advanced options 0 1 1 1
EXECUTE sp_configure 'Database Mail XPs'
name minimum maximum config_value run_value
Database Mail XPs 0 1 1 1
sysmail_server
account_id servertype servername port username credential_id use_default_credentials enable_ssl flags timeout last_mod_datetime last_mod_user
1 SMTP smtp.gmail.com 465 sqlmail#domain.com 65536 0 1 0 NULL 2015-11-23 09:34:26.913 WSCORP\username
sys.credentials
credential_id name credential_identity create_date modify_date target_type target_id
65536 F05ADE33-6AA8-45FC-8FF5-A7631831ECB1 sqlmail#domain.com 2015-11-23 09:34:26.913 2015-11-23 09:34:26.913 NULL NULL
EXEC msdb.sys.sp_helprolemember 'DatabaseMailUserRole'
DbRole MemberName MemberSID
DatabaseMailUserRole WSCORP\username 0x010500000000000515000000F483990DEADF2220C7DB306E6B040000
EXEC msdb.dbo.sysmail_help_principalprofile_sp
principal_id principal_name profile_id profile_name is_default
27 WSCORP\username 1 Default 1
EXECUTE dbo.sysmail_start_sp
Status
STARTED
sysmail_account
account_id name description email_address display_name replyto_address last_mod_datetime last_mod_user
1 SQLMail NULL sqlmail#domain.com SQLExpresspay12 Mail user#domain.com 2015-11-23 09:34:26.843 WSCORP\username
sysmail_profile
profile_id name description last_mod_datetime last_mod_user
1 Default Default profile 2015-11-23 09:56:58.947 WSCORP\username
sysmail_profileaccount
profile_id account_id sequence_number last_mod_datetime last_mod_user
1 1 1 2015-11-23 10:02:29.867 WSCORP\username
sysmail_servertype
servertype is_incoming is_outgoing last_mod_datetime last_mod_user
SMTP 0 1 2010-04-02 17:36:17.340 sa
sysmail_mailitems
mailitem_id profile_id recipients copy_recipients blind_copy_recipients subject from_address reply_to body body_format importance sensitivity file_attachments attachment_encoding query execute_query_database attach_query_result_as_file query_result_header query_result_width query_result_separator exclude_query_output append_query_error send_request_date send_request_user sent_account_id sent_status sent_date last_mod_date last_mod_user
4 1 user#domain.com NULL NULL Test message NULL NULL This is the body of the test message. TEXT NORMAL NORMAL NULL MIME NULL NULL 0 1 256 0 0 0 2015-11-24 08:23:59.493 WSCORP\username NULL 2 11/1124/20158 8:25:20 11/24/2015 08:25:20 sa
Congratulations, Database Mail Received
By you Successfully.
sysmail_log
log_id event_type log_date description process_id mailitem_id account_id last_mod_date last_mod_user
13 1 2015-11-24 08:23:59.787 DatabaseMail process is started 7324 NULL NULL 2015-11-24 08:23:59.787 NT AUTHORITY\NETWORK SERVICE
14 1 2015-11-24 08:24:10.270 The mail queue was started by login "WSCORP\username". NULL NULL NULL 2015-11-24 08:24:10.270 WSCORP\username
15 3 2015-11-24 08:24:10.297 The mail could not be sent to the recipients because of 7324 4 NULL 2015-11-24 08:24:10.297 sa
the mail server failure. (Sending Mail using Account 1
(2015-11-24T08:24:10). Exception Message: Cannot send
mails to mail server. (Failure sending mail.). )
Google wanted me to use the TLS port (587) even though, as far as I can tell, there was no way to tell the SQL server to use TLS. So specifying SSL and using the TLS port worked.