Exchange Onlineでスクリプト(CDO)からメールを送信したい。
-
2011年9月12日 9:34
BPOSでCDOを利用したVBscritからのメール送信をしたいのですが、接続エラーとなりうまくいきません。
サーバーのアドレスなどは、Outlook Expressで設定したものと同じものを使用しているので間違いはないはずなのですが、
「サーバーに接続できませんでした」というエラーになってしまいます。
スクリプトを使用してBPOSのEchange経由でメールを自動送信する方法がありましたら、ご教示ください。■スクリプトのソース
on error resume next
Set oMsg = CreateObject("CDO.Message")
oMsg.From = "e-mail address"
oMsg.To = "e-mail address"
oMsg.Subject = "Test"
oMsg.TextBody = "テストメッセージです" & vbCrLf & Now
oMsg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
oMsg.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.mail.apac.microsoftonline.com"
oMsg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587
oMsg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")= 1
oMsg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
oMsg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "e-mail address"
oMsg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
oMsg.Configuration.Fields.Update
oMsg.Send
if err.number =0 then
wscript.echo "メッセージ送信に成功しました"
else
wscript.echo "メッセージ送信に失敗しました"
wscript.echo "Errno = " & err.number & " " & err.description
end if■実行結果
メッセージ送信に失敗しました
Errno = -2147220973 転送においてサーバーに接続できませんでした。
すべての返信
-
2011年9月13日 5:29モデレータ
お問合せいただきありがとうございます。
誠に恐れ入りますが、本お問合せにつきましては Microsoft Online Services でのご回答は残念ながら難しい内容となります。
フォーラムをご利用いただくのでございましたら、以下のフォーラムはいかがでしょうか。回答を得られるかどうかはお約束致しかねますがご参考いただければ幸いです。
CDO のお問合せの為、セキュアプログラミング系のフォーラムとなります。
http://social.msdn.microsoft.com/Forums/ja-JP/secureprogrammingja/threadsまた早急に解決策が必要な場合は、料金はかかってしまいますが、プロフェッショナルサポートも選択肢としてございます。
電話番号:0120-17-0196
営業時間:平日9:30~19:00(12:00~13:00を除く、土日祝は休業)- 回答としてマーク 365Mod2Moderator 2011年9月26日 18:39

