Quantcast
Channel: OKWAVE 最新質問([技術者向] コンピューター/205)【本日】
Viewing all articles
Browse latest Browse all 38062

エクセル メール送信

$
0
0
夜分遅くに失礼します。 夕方から悩みに悩んで解決しなかったので質問いたしました。 エクセルでのメールを一括送信しております。 現在は一年ほど前に探しに探して見つけたソースを流用し利用してましたが 最近になり、本文に文字化けの現象が出始めました。 その改善策を質問させていただきます。 使用環境は Microsoft Office Excel 2003 Option Explicit Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Sub doit() Dim mymail As New objmail Dim mybody As New objBody Dim lngLine As Long Dim i As Long mymail.fromAddr = "*****" mymail.subject = Range("L4") mymail.textBody = Range("K6") lngLine = Range("A1").End(xlDown).Row For i = 2 To lngLine If Range("A" & i) <> "" Then If Range("E" & i) <> "NG" Then Sleep 2000 mymail.toAddr = Range("A" & i) mymail.send End If Else Exit For End If Next i MsgBox ("送信完了") End Sub =========================================================== Option Explicit Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory. Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network). Const cdoBasic = 1 'basic (clear-text) authentication Const cdoNTLM = 2 'NTLM Const MSgw = "http://schemas.microsoft.com/cdo/configuration/" Dim objCDO As Object Dim initAddr As String Dim destAddr As String Dim Title As String Dim Body As String Private Sub Class_Initialize() Set objCDO = CreateObject("CDO.Message") With objCDO With .Configuration.Fields .Item(MSgw & "sendusing") = 2 .Item(MSgw & "smtpserver") = SMTP_server .Item(MSgw & "smtpauthenticate") = cdoBasic .Item(MSgw & "smtpserverport") = SMTP_port .Item(MSgw & "sendusername") = SMTP_id .Item(MSgw & "sendpassword") = SMTP_pass .Item(MSgw & "smtpconnectiontimeout") = 60 .Item(MSgw & "languagecode") = cdoShift_JIS ' please take care not utf-8 ■■ .Item(MSgw & "smtpusessl") = False .Update End With .MimeFormatted = True End With End Sub ■■の行の文字コードの部分(cdoShift_JIS)を変更すればと思い utf-8 等に変更したのですが 上手くいかず、、、どの様に設定すればいいのか分からない状態です。 どこを変更すれば改善されるのかお教えいただければ幸いです。 どうぞよろしくお願いいたします。

Viewing all articles
Browse latest Browse all 38062

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>