Страница: 1 |
Пример: http://www.vb-helper.com/howto_send_outlook_express_attachment.html NOTE: The procedures that are outlined in this section assume that the you are familiar with creating the type of objects listed in the implementation list. mailto:<to email>?cc=<cc email>&bcc=<bcc Where the following variable definitions apply: Note the position of the question mark (?) and ampersand (& Space ( ) %20 The following is an example of a command-line for the Subject and Body text using these variables: This command-line yields the following information: Subject: Hello World! Страница: 1 |
Вопрос: Как прицепить файл к письму
Добавлено: 01.06.04 21:15
Автор вопроса:
__Сергей__
Пользую-
Call ShellExecute(0&, "Open", "mailto:" + "mail99@mail.ru" & "?Subject=" & "'Здесь описана тема...'" & "?body=" & "'здесь нужно написать сообщение'" & "?a=" & "c:\vc.com", "", "", 1)
тема не полностью, тела письма вообще нет, а самое главное файл не аттачится,
Пользую Express Outlook 97 (работа такая) да и с The Bat пробовал - ни фига.
В MSDN нету, про это. MAPI не желателен.
Может кто скажет, а лучше вышлет? (Ну на крайняк с MAPI).
Ответы
Всего ответов: 3
Номер ответа: 1
Автор ответа: astoro
ICQ: 649109
Вопросов: 31
Ответов: 391
Профиль | | #1
Добавлено: 02.06.04 06:32
Через MAPI так:
Public Function send_mail(sendto As String, _
subject As String, _
text As String) As Boolean
On Error GoTo ErrHandler
With MAPISession1
.DownLoadMail = False
.LogonUI = True
.SignOn
.NewSession = True
MAPIMessages1.SessionID = .SessionID
End With
With MAPIMessages1
.Compose
.RecipAddress = sendto
.AddressResolveUI = True
.ResolveName
.MsgSubject = subject
.MsgNoteText = text
.AttachmentPathName = File1
.AttachmentPathName = File2
.AttachmentPathName = File3
.Send False
End With
send_mail=True
MAPIMessages1.SessionID = 0
MAPISession1.SignOff
Exit Function
ErrHandler:
send_mail=False
End Function
Private Sub Command1_Click()
If MsgBox("Отправить письмо?", vbYesNo + _
vbQuestion) = vbNo Then Exit Sub
a = send_mail ("email@email.ru", "Subject", "Привет" + _
vbCrLf + "Проверка связи!"
Select Case a
Case True
MsgBox ("Письма отправлены!"
Case False
MsgBox ("Письма не отправлены!"
End Select
End Sub
Номер ответа: 2
Автор ответа: Gloom
Вопросов: 0
Ответов: 36
Профиль | | #2
Добавлено: 02.06.04 12:56
Single Command-Line String for a Message with Subject and Body
In order to create a preformatted and pre-addressed e-mail message, it is necessary to build a command-line string with the following parameters:
mail>&subject=<subject text>&body=<body text> Variable Field Entry
--------------------------------------------------------------
<to e-mail> e-mail address to appear in the To field
<cc mail> e-mail address to appear in the CC field
<bcc mail> e-mail address to appear in the BCC field
<subject> text to appear in the Subject field
<body text> text to appear in the Body of the message
characters in the command-line syntax.
In addition to the field designations, you must use ASCII hexadecimal equivalents as variables for punctuation characters. The following variables are used to represent commonly used characters:
Comma (,) %2C
Question Mark (?) %3F
Period (.) %2E
Exclamation Point (!) %21
Colon ( %3A
Semicolon ( %3B
&subject=Hello%20World%21&body=How%20are%20you%2C%20John%3F
Body : How are you, John?
Номер ответа: 3
Автор ответа: tvy
Вопросов: 4
Ответов: 2
Профиль | | #3
Добавлено: 02.06.04 15:43
Можно через CDO. в MSDN есть. Объект Newmail.
Свойство .Attachment="c:\test.txt"