Link to home
Start Free TrialLog in
Avatar of Harry8325
Harry8325

asked on

Mail : Very urgent and Important

Hi Everyone...Please Help me,

i want breif information about sql mail and the way it works basically i need to send an email once there is any update or either insert on the database.
The biggest problem here is how ?

I wrote a trigger which fires when ever anything is done, but i don't know the way to start the sql mail on the server, someone said to me that i need to setup some mail exchange then winnt user , i don't understand how to do this.

By the it would be great if someone could tell me if there is any chance of sending the mail without starting sql mail or using extended storedprocedure xp_sendmail.


Its very important and urgent for me to set this up for my clients, what i need to do is as i said when ever there is an update or insert need to send a mail to particular or goup of users.


i want someone to help me to write what ever is required to to send a mail without the sql mail.


Thanks for ur valuable time and great help in advance.


Hari

Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

I think you need to configure:
* SQLServerAgent and SQLServer services to run under dedicated NT Account (let's say SQLMAIL);
* For this NT Account create an Exchange Account, basing on the NT Account
* Logon on the NT Server where SQL Server is running with this NT Account (SQLMAIL)
* Create a Exchange Profile, and remember the name (let's as SQLMAILPROFILE); you need to install an Exchange Client if not yet done to complete this task.
* Log on to SQLServer Enterprise Manager with administrative permissions, and configure SQLServerAgent (Management) and the SQLMail (Additional Services) to use your profile (SQLMAILPROFILE).

Avatar of danblake
danblake

2 Set up Mail services:
http://msdn.microsoft.com/library/psdk/sql/2_003_4.htm 

OR type
www.msdn.microsoft.com 

Enter "setting up SQLAgentMail" as your search.
Without the "".

Sorted.


This also explains how to use the mail services in all forms.

dan.  



By the it would be great if someone could tell me if there is any chance of sending the mail without starting sql mail or using extended storedprocedure xp_sendmail.

You will need a different utility such as a command line utility.  You have to go and buy one harry.

An example utility would be blat.

dan.
Avatar of Harry8325

ASKER

hey guys i need specifically how to send mail without setting up sql mail....this task is on my neck right now and i can please tell if we can or cannot do it what's the reason.

thanks.
Once i try to start the mail it gives me this message.,
SQL-DMO(ODBC SQL STATE:42000)
Error 17952 :
failed to start sql mail session check the error log file in the sql server directory for details.

When i checked in the error log file i found :

first it said starting sql mail session.
NextOperating system error 126.,the specified module could not be found.
Finally failed to start sql mail session.

Guys is there any other alternative to sql mail like some stored procedure which i can use or write in certain format to send or receieve a mail.
Harry setting up sql mail is easy.

You obviously do not have the mail service set up on the server.

Logon to the Microsoft® Windows NT® server specifying the name and password used to start SQL Server services for that server.
Create and configure or copy an existing mail profile by clicking on the Mail icon in Control Panel. Select the appropriate mail service to interact with your mail host. Choose a name for the profile that will help the recipient identify the messages.

--> Have you done the above + tested it ?
--> Write down the name of the profile you gave it for example: 'sql mail'
On the server running Microsoft SQL Server™, start the mail client using the newly created mail profile.
Right click SQL MAil, properties.  Select 'sql mail' as your profile name.  Click test.  This tests the mail profile.

To test your mail profile:
Send a message addressed to the same profile name to ensure the mail client, mail profile, and e-mail provider are working properly. If your e-mail message does not appear, you may need to force mail synchronization by going to the Tools menu, and then clicking Deliver Now.
Exit the mail client program.
 
A mail profile is an email box running on Outlook or from NT Exchange Server.

This is simple harry8325.  I wouldn't give up.

The alternative is to BUY a utility (note word BUY).

You have 2 choices:
Get SQL Mail up and running OR
Spend money + buy another utility.

Either of these fails, looks like your fired.

dan.
Once i try to start the mail it gives me this message.,
SQL-DMO(ODBC SQL STATE:42000)
Error 17952 :
failed to start sql mail session check the error log file in the sql server directory for details.

When i checked in the error log file i found :

first it said starting sql mail session.
NextOperating system error 126.,the specified module could not be found.
Finally failed to start sql mail session.

Guys is there any other alternative to sql mail like some stored procedure which i can use or write in certain format to send or receieve a mail.
ASKER CERTIFIED SOLUTION
Avatar of danblake
danblake

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Harry,

There is NO other alternative than getting SQLMAil up and running as noted by last BOL item.

Mail can only be sent out of sql server via a compliant MAPI-1 mail server program.

MAPI-1 MS products:
  MS Exchange Server
  MS Outlook

dan.
what is the error message me how to get through this...can u take a example name and explain the whole process of setting up the mail.

i have hkiran@company.com as my mail id can i use this as profile...could u please tell me what need to be done using this name as example starting from setting up the exchange server then creating progfile then client installion on the sql server and invoking etc i don't really get that.

can u please let me know

thanks,

hari
hkiran@company.com this is not your profile.

Using a local administrator account (see your nt guys if not sure what this is - Administrator is the default user name).

Make sure you are logged in 2 the server.
Go Control Panel.
Open up the Mail Icon.
Check there is a profile in there it will not be hkiran@company.com it is probably called 'MS Exchange Settings'.

Thats Step 1 The profile exists.  MY web links explain this also.  I can tell that instructions are not your strong point.
If the profile does not exist see web info at end for step 1 - but generally to create a new profile make sure a mail service is there.  Press properties on any mail service this allows you to see the profiles on the machine as stored.  Some mail services can only have one profile.

Step 2 go to the server add the profile.  You need then to check that the SQL Server starts up using a domain NT account.  This is so that the SQL Server can start the mail account + get mail from it.  This also is a requirement for any networked part of SQL Server to work.

Step 3.  Start the mail service.  Voila it all works it will want to send a test email...


dan.

See Web info:  (STep 1)
Logon to the Microsoft® Windows NT® server specifying the name and password used to start SQL Server services for that server.
Create and configure or copy an existing mail profile by clicking on the Mail icon in Control Panel. Select the appropriate mail service to interact with your mail host. Choose a name for the profile that will help the recipient identify the messages.
On the server running Microsoft SQL Server™, start the mail client using the newly created mail profile.
Send a message addressed to the same profile name to ensure the mail client, mail profile, and e-mail provider are working properly. If your e-mail message does not appear, you may need to force mail synchronization by going to the Tools menu, and then clicking Deliver Now.
Exit the mail client program.
 
STEP 2:
How to set up SQL Mail (Enterprise Manager)
To set up SQL Mail

Expand a server group; then expand a server.
Click Support Services, right-click SQL Mail, and then click Properties.
In Profile name, select the mail profile that you configured for SQL Mail.
Click Test to check the systems ability to start and stop mail client services with the profile entered. You should receive a message that SQL Mail has started successfully and stopped a mail session with this profile.
 
STEP 3: