찾다
데이터 베이스MySQL 튜토리얼How to send email using sqlserver

This is from CodeProject:http://www.codeproject.com/Articles/846204/How-To-Send-Mail-Using-SQL-Server-Part Introduction There are three parts for this tutorial: Configure email profile and send test email using SQL Server Select and send d

This is from CodeProject:http://www.codeproject.com/Articles/846204/How-To-Send-Mail-Using-SQL-Server-Part

Introduction

There are three parts for this tutorial:

  • Configure email profile and send test email using SQL Server
  • Select and send data in mail
  • Schedule daily mail from SQL Server

Step 1

Log in to SQL Server 2008 with a correct user name and password.

Step 2

Expand the Management tab, then select SQL Server Logs, then right-click on Database Mail, then select Configure Database Mail.

How to send email using sqlserver

Step 3

The following window appears:

How to send email using sqlserver

Click Next.

Step 4

Select the Set up Database Mail by performing the following tasks: radio button.

How to send email using sqlserver

Step 5

Click Next, then a confirmation box appears; click OK on that.

How to send email using sqlserver

Step 6

When you click OK, then write the profile name description and click on Add.

How to send email using sqlserver

Step 7

Then, a new window appears where you provide your profile name and configure Outgoing Mail Server(SMTP) then click Basic authentication and provide your email id and password then click OK.

How to send email using sqlserver

Step 8

Then in the new window, it will show your profile, check that and click Next.

How to send email using sqlserver

Step 9

Then in the new window, the Configure System Parameters description is shown.

How to send email using sqlserver

Step 10

Click Next. It will show a confirmation about your profile; click Finish.

How to send email using sqlserver

Step 11

Now the email service has been configured, click Close.

How to send email using sqlserver

Step 12

Send a test email by right-clicking on database mail and click Send Test E-Mail.

How to send email using sqlserver

Step 13

Provide the Test Email Id and click On Send Test E-Mail. Then check your mail to see if you got the mail. Enjoy!!

How to send email using sqlserver

Note

After the Account and the Profile are created successfully, we need to configure the Database Mail. To configure it, we need to enable the Database Mail XPs parameter using the sp_configure Stored Procedure, as shown here:

How to send email using sqlserver Collapse | Copy Code

    sp_CONFIGURE <span>'</span><span>show advanced'</span>, <span>1</span>  
    <span>GO</span>  
    <span>RECONFIGURE</span>  
    <span>GO</span>  
    sp_CONFIGURE <span>'</span><span>Database Mail XPs'</span>, <span>1</span>  
    <span>GO</span>  
    <span>RECONFIGURE</span>  
    <span>GO</span>  

Output Message

The Configuration option "show advanced options" changed from 0 to 1. Run the RECONFIGURE statement to install.

The configuration option "Database Mail XPs" changed from 1 to 1. Run the RECONFIGURE statement to install.

Use the following query to send mail using query:

Send Mail Query

USE msdb;--Must Use msdb database, otherwise you will get error.

How to send email using sqlserver Collapse | Copy Code

    <span>GO</span>  
    <span>EXEC</span> sp_send_dbmail @profile_name=<span>'</span><span>MyTestMail'</span>,  
    @recipients=<span>'</span><span>manishki@live.com'</span>,  
    @subject=<span>'</span><span>My Test Mail Service.'</span>,  
    @body=<span>'</span><span>Database Mail Received Successfully.'</span>   

This is the body of this message.

Note

If you are using a database other than msdb, then use a stored procedure like msdb.dbo.sp_send_dbmail. The log can be checked in sysmail_log table as shown below:

How to send email using sqlserver Collapse | Copy Code

    <span>SELECT</span> * <span>FROM</span> sysmail_mailitems  
    <span>GO</span>  
    <span>SELECT</span> * <span>FROM</span> sysmail_log  
    <span>GO</span>  
    <span>select</span> * <span>from</span> sysmail_log  
성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
MySQL은 sqlite와 어떻게 다릅니 까?MySQL은 sqlite와 어떻게 다릅니 까?Apr 24, 2025 am 12:12 AM

MySQL과 Sqlite의 주요 차이점은 설계 개념 및 사용 시나리오입니다. 1. MySQL은 대규모 응용 프로그램 및 엔터프라이즈 수준의 솔루션에 적합하며 고성능 및 동시성을 지원합니다. 2. SQLITE는 모바일 애플리케이션 및 데스크탑 소프트웨어에 적합하며 가볍고 내부질이 쉽습니다.

MySQL의 색인이란 무엇이며 성능을 어떻게 향상 시키는가?MySQL의 색인이란 무엇이며 성능을 어떻게 향상 시키는가?Apr 24, 2025 am 12:09 AM

MySQL의 인덱스는 데이터 검색 속도를 높이는 데 사용되는 데이터베이스 테이블에서 하나 이상의 열의 주문 구조입니다. 1) 인덱스는 스캔 한 데이터의 양을 줄임으로써 쿼리 속도를 향상시킵니다. 2) B-Tree Index는 균형 잡힌 트리 구조를 사용하여 범위 쿼리 및 정렬에 적합합니다. 3) CreateIndex 문을 사용하여 CreateIndexIdx_customer_idonorders (customer_id)와 같은 인덱스를 작성하십시오. 4) Composite Indexes는 CreateIndexIdx_customer_orderOders (Customer_id, Order_Date)와 같은 다중 열 쿼리를 최적화 할 수 있습니다. 5) 설명을 사용하여 쿼리 계획을 분석하고 피하십시오

MySQL에서 트랜잭션을 사용하여 데이터 일관성을 보장하는 방법을 설명하십시오.MySQL에서 트랜잭션을 사용하여 데이터 일관성을 보장하는 방법을 설명하십시오.Apr 24, 2025 am 12:09 AM

MySQL에서 트랜잭션을 사용하면 데이터 일관성이 보장됩니다. 1) STARTTRANSACTION을 통해 트랜잭션을 시작한 다음 SQL 작업을 실행하고 커밋 또는 롤백으로 제출하십시오. 2) SavePoint를 사용하여 부분 롤백을 허용하는 저장 지점을 설정하십시오. 3) 성능 최적화 제안에는 트랜잭션 시간 단축, 대규모 쿼리 방지 및 격리 수준을 합리적으로 사용하는 것이 포함됩니다.

MySQL을 통해 어떤 시나리오에서 PostgreSQL을 선택할 수 있습니까?MySQL을 통해 어떤 시나리오에서 PostgreSQL을 선택할 수 있습니까?Apr 24, 2025 am 12:07 AM

MySQL 대신 PostgreSQL을 선택한 시나리오에는 다음이 포함됩니다. 1) 복잡한 쿼리 및 고급 SQL 기능, 2) 엄격한 데이터 무결성 및 산 준수, 3) 고급 공간 기능이 필요하며 4) 큰 데이터 세트를 처리 할 때 고성능이 필요합니다. PostgreSQL은 이러한 측면에서 잘 수행되며 복잡한 데이터 처리 및 높은 데이터 무결성이 필요한 프로젝트에 적합합니다.

MySQL 데이터베이스를 어떻게 보호 할 수 있습니까?MySQL 데이터베이스를 어떻게 보호 할 수 있습니까?Apr 24, 2025 am 12:04 AM

MySQL 데이터베이스의 보안은 다음 조치를 통해 달성 할 수 있습니다. 1. 사용자 권한 관리 : CreateUser 및 Grant 명령을 통한 액세스 권한을 엄격히 제어합니다. 2. 암호화 된 전송 : 데이터 전송 보안을 보장하기 위해 SSL/TLS를 구성합니다. 3. 데이터베이스 백업 및 복구 : MySQLDump 또는 MySQLPump를 사용하여 정기적으로 백업 데이터를 사용하십시오. 4. 고급 보안 정책 : 방화벽을 사용하여 액세스를 제한하고 감사 로깅 작업을 가능하게합니다. 5. 성능 최적화 및 모범 사례 : 인덱싱 및 쿼리 최적화 및 정기 유지 보수를 통한 안전 및 성능을 모두 고려하십시오.

MySQL 성능을 모니터링하는 데 사용할 수있는 몇 가지 도구는 무엇입니까?MySQL 성능을 모니터링하는 데 사용할 수있는 몇 가지 도구는 무엇입니까?Apr 23, 2025 am 12:21 AM

MySQL 성능을 효과적으로 모니터링하는 방법은 무엇입니까? Mysqladmin, Showglobalstatus, Perconamonitoring and Management (PMM) 및 MySQL Enterprisemonitor와 같은 도구를 사용하십시오. 1. MySQLADMIN을 사용하여 연결 수를보십시오. 2. showglobalstatus를 사용하여 쿼리 번호를보십시오. 3.pmm은 자세한 성능 데이터 및 그래픽 인터페이스를 제공합니다. 4. MySQLENTERPRISOMITOR는 풍부한 모니터링 기능 및 경보 메커니즘을 제공합니다.

MySQL은 SQL Server와 어떻게 다릅니 까?MySQL은 SQL Server와 어떻게 다릅니 까?Apr 23, 2025 am 12:20 AM

MySQL과 SqlServer의 차이점은 1) MySQL은 오픈 소스이며 웹 및 임베디드 시스템에 적합합니다. 2) SQLServer는 Microsoft의 상용 제품이며 엔터프라이즈 수준 애플리케이션에 적합합니다. 스토리지 엔진의 두 가지, 성능 최적화 및 응용 시나리오에는 상당한 차이가 있습니다. 선택할 때는 프로젝트 규모와 향후 확장 성을 고려해야합니다.

MySQL을 통해 어떤 시나리오에서 SQL Server를 선택할 수 있습니까?MySQL을 통해 어떤 시나리오에서 SQL Server를 선택할 수 있습니까?Apr 23, 2025 am 12:20 AM

고 가용성, 고급 보안 및 우수한 통합이 필요한 엔터프라이즈 수준의 응용 프로그램 시나리오에서는 MySQL 대신 SQLServer를 선택해야합니다. 1) SQLServer는 고 가용성 및 고급 보안과 같은 엔터프라이즈 수준의 기능을 제공합니다. 2) VisualStudio 및 Powerbi와 같은 Microsoft Ecosystems와 밀접하게 통합되어 있습니다. 3) SQLSERVER는 성능 최적화에서 우수한 성능을 발휘하며 메모리 최적화 된 테이블 및 열 스토리지 인덱스를 지원합니다.

See all articles

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

Video Face Swap

Video Face Swap

완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

뜨거운 도구

맨티스BT

맨티스BT

Mantis는 제품 결함 추적을 돕기 위해 설계된 배포하기 쉬운 웹 기반 결함 추적 도구입니다. PHP, MySQL 및 웹 서버가 필요합니다. 데모 및 호스팅 서비스를 확인해 보세요.

에디트플러스 중국어 크랙 버전

에디트플러스 중국어 크랙 버전

작은 크기, 구문 강조, 코드 프롬프트 기능을 지원하지 않음

ZendStudio 13.5.1 맥

ZendStudio 13.5.1 맥

강력한 PHP 통합 개발 환경

안전한 시험 브라우저

안전한 시험 브라우저

안전한 시험 브라우저는 온라인 시험을 안전하게 치르기 위한 보안 브라우저 환경입니다. 이 소프트웨어는 모든 컴퓨터를 안전한 워크스테이션으로 바꿔줍니다. 이는 모든 유틸리티에 대한 액세스를 제어하고 학생들이 승인되지 않은 리소스를 사용하는 것을 방지합니다.

SublimeText3 Mac 버전

SublimeText3 Mac 버전

신 수준의 코드 편집 소프트웨어(SublimeText3)