Il existe bien sûr la méthode SQL (via DB Mail ou SQL Mail), mais voici 2 autres méthodes alternatives (qui peuvent être utiles pour SQL Express par exemple) :
1°) via un script VB Script :
tout est décrit ici : An alternative to SQL Server email alerts
2°) via un script PowerShell :
$user = "[USER]" $emailFrom = $user + "@yourdomain.com" $emailTo = $user + "_to@yourdomain.com" $subject = "your subject" $body = "your message body" $smtpServer = "[SMTP_SERVER]" $smtpClient = new-object Net.Mail.SmtpClient($smtpServer) # for non-authenticated mail, comment the line below $smtpClient.UseDefaultCredentials = $True $smtpClient.Send($emailFrom, $emailTo, $subject, $body)
$user = "[USER]"
$emailFrom = $user + "@yourdomain.com"
$emailTo = $user + "_to@yourdomain.com"
$subject = "your subject"
$body = "your message body"
$smtpServer = "[SMTP_SERVER]"
$smtpClient = new-object Net.Mail.SmtpClient($smtpServer)
# for non-authenticated mail, comment the line below
$smtpClient.UseDefaultCredentials = $True
$smtpClient.Send($emailFrom, $emailTo, $subject, $body)