question

sql2012 avatar image
sql2012 asked

Send email from sql server 2012

Hi I am new to sql sever 2012. I have problem in sending email from the SSMS or from writing script. currently i have window 7 and sql server 2012. i have followed the instructions to enable the database mail and created a mail profile also. when i tested it. the email did not send out, but it is in MSDB mail tables. I think that I did not use the correct SERVER NAME for the smtp when i created the database mail account. Could anyone please tell me what did I miss and what are the logical steps that i need to do to make the send mail feature work in sql server 2012? I am doing this for personal use and learning. I try to write stored procedure to send out email from sql server to all the tenants. Before i can make i t works I need to be able test the send email from the Database Mail. what server name i need to use when i create the database email account? I really appreciate you step in to help. thanks
sql-servermaildatabase-mail
2 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

What errors are you seeing? Can you share them?
0 Likes 0 ·
Hi thanks for review my question. i tested again by using Databasmal e Test Email, it displayed a message, "The test email has been queured for processing...", and above it, it shown Sent email: 7. Then i check the log, it shown two entries. 1. Database Mail process is started 2. Database Mail process is shutting down. I think the main issue is that i do not know what is SERVER NAME I SHOULD ENTER under the Outgoing mail server (SMTP) when I created the new database account and profile. can I get the Ip address from the IIS? because I do have window server. Does SQL SERVER 11.0.2100.60 VERSION 2012 have the SMTP component that i can configure to use as SMTP for the email function to work? any advices are greatly appreciated. Fong
0 Likes 0 ·
Dave_Green avatar image
Dave_Green answered
Hello, SQL Server does not itself have an SMTP service component - you need to send through a separate mail server. This can be either a local one ([IIS does provide one, here is how to configure it for windows 7][1]) or a remote one ([an example using Windows Live or Gmail is provided here][2]). Once you have decided on an email server, you need to provide this into your Database Mail profile. I hope that helps. [1]: http://technet.microsoft.com/en-us/library/cc772058(v=ws.10).aspx [2]: http://blogs.msdn.com/b/suhde/archive/2009/07/12/how-to-configure-sql-server-database-mail-to-send-email-using-your-windows-live-mail-account-or-your-gmail-account.aspx
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sql2012 avatar image
sql2012 answered
Thank you I will take a look later. I did try to add SMTP from window, but i could not find the component from the list of features. hope the link above will point to the location get it. i will update you later when i have a chance to work on it. thanks for your time and advices.
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.