sp_send_dbmail ストアド プロシージャを使用してメールを送信しています。別の SP から sp_send_dbmail SP を実行しています。sp_send_dbmail SP を実行する前に、インターネット接続を確認したいと思います。インターネット接続を見つけるためのクエリはありますか。私にお知らせください。
2 に答える
Why would you want to check Internet connectivity? Internet connectivity is no indicator of whether or not sp_send_dbmail will work.
When I supported a SQL Server, the SQL Server box had Internet connectivity but that connection was not used to send emails. Instead, the SQL Server box forwarded all emails to our mail server which ultimately sent them.
If you check the Remarks section of the article on sp_send_dbmail, you will see that the success of sending emails has to do with configuring mail services and not Internet connectivity.
で実装Exception handling
するStored Proc
と、次の詳細が得られます。
エラーメッセージ
SQL Server への接続を確立中に、ネットワーク関連またはインスタンス固有のエラーが発生しました。サーバーが見つからないか、アクセスできませんでした。インスタンス名が正しいこと、および SQL Server がリモート接続を許可するように構成されていることを確認してください。(プロバイダー: 名前付きパイプ プロバイダー、エラー: 40 - SQL Server への接続を開けませんでした)
エラー番号 - 53
これは理想的な方法ではありませんが、エラー番号/メッセージをチェックして、リクエストが宛先に到達できるかどうかを確認できます。以下のスクリーンショットを参照してください...