|
編集中のファイルをメール送信
- ページ: Macro/投稿
- 作者: maru
- カテゴリー: vbs
- 投稿日: 2006-08-24 (木) 01:15:58
メッセージ
- アドレス帳の機能がないので送信先は決め打ちです.
- 件名はファイル名(拡張子除く)となります.
- Win2000以降
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
| | Option Explicit
Const SMTP_SERVER = "mail.xxxxxx.co.jp"
Const MAIL_TO = "xxxxx@xxxxx.co.jp;xxxxx@xxxxx.com"
Const MAIL_CC = ""
Const MAIL_FROM = "sakura-editor@localhost.localdomain"
Call SendMail
Private Sub SendMail()
Dim oMsg
Set oMsg = CreateObject("CDO.Message")
oMsg.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
oMsg.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTP_SERVER
oMsg.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
oMsg.Configuration.Fields.Update
oMsg.From = MAIL_FROM
oMsg.Subject = ExpandParameter(CStr("$g"))
SelectAll
oMsg.TextBody = GetSelectedString(CLng(0))
If MAIL_TO <> "" Then oMsg.To = MAIL_TO
If MAIL_CC <> "" Then oMsg.Cc = MAIL_CC
oMsg.Send
End Sub
|
|
|