共計 2034 個字符,預計需要花費 6 分鐘才能閱讀完成。
如何使用 SQL Mail 收發和自動處理郵件中的擴展存儲,針對這個問題,這篇文章詳細介紹了相對應的分析和解答,希望可以幫助更多想解決這個問題的小伙伴找到更簡單易行的方法。
一、啟動 SQL Mail
xp_startmail @user,@password
@user 和 @password 都是可選的
也可打開 Enterprise Manager 中的 Support Services,在 SQL Mail 上單擊右鍵打開右鍵菜單,然后按 Start 來啟動
二、停止 SQL Mail
xp_stopmail
也可用上述方法中的菜單里的 Stop 來停止
三、發送郵件
xp_sendmail {[@recipients =] recipients [;…n] }
[,[@message =] message
[,[@query =] query
[,[@attachments =] attachments]
[,[@copy_recipients =] copy_recipients [;…n]
[,[@blind_copy_recipients =] blind_copy_recipients [;…n]
[,[@subject =] subject
[,[@type =] type
[,[@attach_results =] attach_value
[,[@no_output =] output_value
[,[@no_header =] header_value
[,[@width =] width]
[,[@separator =] separator
[,[@echo_error =] echo_value
[,[@set_user =] user
[,[@dbuse =] database
其中 @recipients 是必需的
參數說明:
參數 說明
@recipients 收件人,中間用逗號分開
@message 要發送的信息
@query 確定執行并依附郵件的有效查詢,除觸發器中的插入表及刪除表外,此查詢能引用任何對象
@attachments 附件
@copy_recipients 抄送
@blind_copy_recipients 密送
@subject 標題
@attach_results 指定查詢結果做為附件發送
@no_header 不發送查詢結果的列名
@set_user 查詢聯接的用戶名,默認為 Guset
@dbuse 查詢所用的數據庫,默認為缺省數據庫
四、閱讀郵件收件箱中的郵件
xp_readmail [[@msg_id =] message_number [, [@type =] type [OUTPUT]]
[,[@peek =] peek
[,[@suppress_attach =] suppress_attach
[,[@originator =] sender OUTPUT]
[,[@subject =] subject OUTPUT]
[,[@message =] message OUTPUT]
[,[@recipients =] recipients [;…n] OUTPUT]
[,[@cc_list =] copy_recipients [;…n] OUTPUT]
[,[@bcc_list =] blind_copy_recipients [;…n] OUTPUT]
[,[@date_received =] date OUTPUT]
[,[@unread =] unread_value OUTPUT]
[,[@attachments =] attachments [;…n] OUTPUT])
[,[@skip_bytes =] bytes_to_skip OUTPUT]
[,[@msg_length =] length_in_bytes OUTPUT]
[,[@originator_address =] sender_address OUTPUT]]
參數說明:
參數 說明
@originator 發件人
@subject 主題
@message 信息
@recipients 收件人
@skip_tytes 讀取郵件信息時跳過的字節數,用于順序獲取郵件信息段。
@msg_length 確定所有信息的長度,通常與 @skip_bytes 一起處理長信息
五、順序處理下一個郵件
xp_findnextmsg [[@msg_id =] message_number [OUTPUT]]
[,[@type =] type]
[,[@unread_only =] unread_value )
六、刪除郵件
xp_deletemail {message_number}
如果不指定郵件編號則刪除收件箱中的所有郵件
七、自動處理郵件
sp_processmail [[@subject =] subject
[,[@filetype =] filetype
[,[@separator =] separator
[,[@set_user =] user
[,[@dbuse =] dbname
關于如何使用 SQL Mail 收發和自動處理郵件中的擴展存儲問題的解答就分享到這里了,希望以上內容可以對大家有一定的幫助,如果你還有很多疑惑沒有解開,可以關注丸趣 TV 行業資訊頻道了解更多相關知識。