Sending Mails


Is it possible to send mails from Sql Server installed on a Stand-alone computer? If not, what are the requirements?

Kindly let me know.

Rgds Mohan Kumar VS

more ▼

asked Sep 12, 2011 at 12:07 AM in Default

avatar image

Mohan Kumar
204 19 20 24

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

Yes, it is possible. You should Enable Database Mail from SQL Server Surface Area Configuration for Features - Start Menu->SQL Server 2005->Configuration Tools->SQL Server Surface Area Configuration for SQL Server 2005, probably something similar for SQL Server 2008, SQL Server 2008 R2 and Denali (you don't mention your version, so I'm assuming 2005 or later)

You can then send mail from a stored procedure using stored proc msdb.dbo.sp_send_dbmail

That is documented here: http://msdn.microsoft.com/en-us/library/ms190307.aspx

more ▼

answered Sep 12, 2011 at 12:22 AM

avatar image

Magnus Ahlkvist
21.6k 19 41 42

Thank You. While creating New database mail account it asks for Server Name & SMTP Authentication. I'm using gmail account, so what should be the server name & SMTP authentication?

Rgds Mohan Kumar VS

Sep 12, 2011 at 02:50 AM Mohan Kumar

The SMTP server is normally one provided by your internet provider.

You could also use the public gmail SMTP server, but then you'll probably have to use port number 587, since port number 25 is in most networks blocked. If you have SSL secure connection, use port number 465.

The gmail public SMTP server name is smtp.gmail.com.

Regarding SMTP authentication: Use your gmail mail-address and password.

The details I've written are taken from this instruction on setting up gmail for Thunderbird client: http://mail.google.com/support/bin/answer.py?hl=en&answer=77662

Sep 12, 2011 at 03:43 AM Magnus Ahlkvist

Thanks. I gave the server name as smtp.gmail.com and 587 as port number with anonymous authentication. But the following error is shows in the log after send the test mail: Message The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 2 (2011-09-12T16:45:14). Exception Message: Cannot send mails to mail server. (The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at ). )

Sep 12, 2011 at 04:32 AM Mohan Kumar

You cannot send mails through Gmails public SMTP server without authentication. Use your Gmail login credentials when you set up the connection.

Sep 12, 2011 at 04:52 AM Magnus Ahlkvist

I also tried with Gmail crendtials... but the same error occurs...

Sep 12, 2011 at 04:56 AM Mohan Kumar
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Sep 12, 2011 at 12:07 AM

Seen: 2507 times

Last Updated: Sep 12, 2011 at 12:07 AM

Copyright 2016 Redgate Software. Privacy Policy