SQLAgent Mail, MS Outlook | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

SQLAgent Mail, MS Outlook

I have MS Outlook 2000 as a mail client. In my SQL Server Agent
properties, there is only one selection: MS Exchange Settings available for Mail session, so I selected this. I also have [SMTP:[email protected]] (or [MAPI:[email protected]], or [email protected]) configured as E-mail name in a sqlagent job (Notifications tab). But when I "Test" the mail profile in SQL Server Agent properties,
I got an error: 22022: unable to get the default MAPI message stored due to MAPI
error 262. MAPI was unable to load the info service ommapi.dll. The ommapi.dll is correctly installed in C:WINNTSystem32. Thanks for your help! -Mingus
What is the level of service pack on SQL & OS? What are the privileges for SQL Services account? The messages about the Messaging API (MAPI) information store could signal that you’re using a personal store (.pst) file to store the mail. If so, you need to use a server-side mailbox and eliminate the .pst file as your default mail store. Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
(1) SQL Server 2K SP3
(2) OS: Win2K Prof SP3
(3) myself logged on as network domain user with admin access on the PC;
(4) inbox is default to network location instead of local drive. Even though sqlagent is started, but sqlagent mail is not: MAPI error 262. Unable to logon. Unable to get the default MAPI msg
store due to MAPI error 262: unexpected.

Thanks!

Another reason is that your mail profile is corrupted or the name of the profile is greater than 32 characters. You may want to try deleting the mail profile and re-creating it with a shorter name to ensure that you have a working mail profile. Check the following events: – The account you use to start the SQL Server service must be a domain account if you are using an Exchange server. The domain account must have a mailbox on the Exchange server. If you are using an Internet mail server, you can use a local account to start SQL Server. However, the account you use to start SQL Server cannot be the Local System account, under any circumstances. The same applies to the service account you use to start the SQL Agent if you are using SQLAgentMail. – Because mail profiles are associated with a Microsoft Windows login account, you must log on to the computer that is running SQL Server with the SQL Server service startup account in order to inspect the mail profile available to SQL Server. For example, open Control Panel. In the Control Panel dialog box, double-click Mail. In the Mail dialog box, double-click Show Profiles. If you are using SQLAgentMail and the SQL Agent service account is different from the SQL Server service account, you must also log on with the SQL Agent service startup account to inspect the mail profiles available to the SQL Agent. – The default Internet e-mail program must be the same as the mail client you use to test the mail configuration. To make sure you have the correct program, open Control Panel, double-click Internet Options, and then click the Programs tab. – For any of the preceding changes to take effect, you must stop, and then restart the SQL Server service. If you reconfigure the default mail profile, you must restart the computer for the changes to take effect.
Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
Thanks Satya. (1) your mail profile is corrupted or the name of the profile is greater than 32 characters –>
I tried both the default "MS Exchange Settings" and
my company profile "Xxxxxx Yyyyyyyyy, Inc", restarted SqlserverAgent.
Not working (see also response to (7)); (2) The account you use to start the SQL Server service must be a domain account —
Yes it is a network domain acct, not a System Account. The same acct I use to logon
to my Windows acct, to start sqlserveragent, sqlserver. (3) if you are using an Exchange server. The domain account must have a mailbox on the Exchange server –
Yes, my domain acct has a mailbox on the mail server; (4) under any circumstances. The same applies to the service account you use to start the SQL Agent if you are using SQLAgentMail –
Sounds like I cannot start the SQLAgentMail. When I tried to "Test" a Notification
for a Sqlagent Job, with an e-mail name: [MAPI:[email protected]], it complained:
Error 22022: The Sqlserveragent mail is not running…
While I went back to check the Mail Profile under sqlagent properties,
profile is "MS Exchange Settings", a Test click returned me:
Unable to get the default MAPI message store due to MAPI error 262:
MAPI was unable to load the info service ommapi.dll. Be sure that
service is correctly installed and configured; (5) Because mail profiles are associated with a Microsoft Windows login account, you must log on to the computer that is running SQL Server with the SQL Server service startup account in order to inspect the mail profile available to SQL Server —
Yes that is what I have been doing; (6) The default Internet e-mail program must be the same as the mail client you use to test the mail configuration. To make sure you have the correct program, open Control Panel, double-click Internet Options, and then click the Programs tab —
It shows "Microsoft Outlook";
But the profile I choose is "MS Exchange Settings".
When I start Mail in Control Panel, the service tab shows:
"HP Openmail(with server store)", NOTE there is no "HP Openmail(without server store)",
Show profile shows "MS Exchange Settings"; (7) For any of the preceding changes to take effect, you must stop, and then restart the SQL Server service. If you reconfigure the default mail profile, you must restart the computer for the changes to take effect.
— I cannot change the default mail profile from "MS Exchange Settings" to
"Xxxxxx Yyyyyyyyy, Inc", because I wouldn’t be able to restart Outlook after rebooting.
I have to stick with mail profile "MS Exchange Settings".

For the point 4:
Try to start SQLAGent seperately from Service Manager, if it fails then check whether this KBAhttp://support.microsoft.com/default.aspx?scid=kb;en-us;303287 has any reference. Check out SQLAgent.OUT file, make sure you run with verbose logging on, use:
exec msdb.dbo.sp_set_sqlagent_properties @errorlogging_level = 7 If possible post related information of LOG file with this setting turned on,
exec msdb.dbo.sp_get_sqlagent_properties If nothing works out then I would suggest to approach MS Support for a fix or solution in your case. Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
Thanks satya. Likely there is nothing wrong with my sqlagent – I could run other maint jobs
without any problem.
The Error Log I got from sqlserverAgent is:
[260]Unable to start mail session[reason:Unable to logon[Reason:Unable to
get the default MAPI Message Store due to MAPI error 262: an unexpected
error has ocuurred. I did run
exec msdb.dbo.sp_set_sqlagent_properties @errorlogging_level = 7 and
exec msdb.dbo.sp_get_sqlagent_properties Some of the returned values are: auto_start = 1
msx_server_name = NULL
sql_agent_type = 1
startup_account = <my network domain account>
sqlserver_restart = 1
errorlog_file = d:program FilesMicro…
errorlogging_level = 7
error_recipient = NULL
monitor_autostart = 0
local_host_server = NULL
job_shutdown_timwout = 15
cmdexec_account = NULL
regular_connection = 0
host_login_name = NULL
host_login_password = NULL
email_profile = MS Exchange Settings
email_save_in_sent_folder = 1
cpu_poller_enabled = 0 Hope this diagnosis would identify something wrong in
my setup.
My last assumption would be to try applying SP3a and see the results, if not as referred goto MS Support. Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
]]>