Group:  Microsoft Access ยป microsoft.public.access.modulescoding
Thread: sending emails from access through outlook express

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

sending emails from access through outlook express
"Sam" <focus10[ at ]zahav.net.il> 26.07.2006 06:18:53
i found in http://www.granite.ab.ca/access/email/mapi.htm a code for sending
emails from access through outlook express.
how can i add to this code the option for sending attchments?

Option Explicit

Type MAPIRecip
Reserved As Long
RecipClass As Long
Name As String
Address As String
EIDSize As Long
EntryID As String
End Type

Type MAPIFileTag
Reserved As Long
TagLength As Long
Tag() As Byte
EncodingLength As Long
Encoding() As Byte
End Type

Type MAPIFile
Reserved As Long
Flags As Long
Position As Long
PathName As String
FileName As String
FileType As Long
End Type
Type MAPIMessage
Reserved As Long
Subject As String
NoteText As String
MessageType As String
DateReceived As String
ConversationID As String
Originator As Long
Flags As Long
RecipCount As Long
Recipients As Long
Files As Long
FileCount As Long
End Type

Declare Function MAPISendMail _
Lib "c:\program files\outlook express\msoe.dll" ( _
ByVal Session As Long, _
ByVal UIParam As Long, _
message As MAPIMessage, _
ByVal Flags As Long, _
ByVal Reserved As Long) As Long

Sub SendMailWithOE(ByVal strSubject As String, ByVal strMessage As String,
ByRef
aRecips As Variant)
Dim recips() As MAPIRecip
Dim message As MAPIMessage
Dim z As Long
ReDim recips(LBound(aRecips) To UBound(aRecips))
For z = LBound(aRecips) To UBound(aRecips)
With recips(z)
.RecipClass = 1
If InStr(aRecips(z), "[ at ]") <> 0 Then
.Address = StrConv(aRecips(z), vbFromUnicode)
Else
.Name = StrConv(aRecips(z), vbFromUnicode)
End If
End With
Next z
With message
.NoteText = strMessage
.Subject = strSubject
.RecipCount = UBound(recips) - LBound(aRecips) + 1
.Recipients = VarPtr(recips(LBound(recips)))
End With
MAPISendMail 0, 0, message, 0, 0
End Sub

Sub TestSendMailwithOE()
Dim aRecips(0 To 0) As String
aRecips(0) = "smtp:t...[ at ]syspac.com"
SendMailWithOE "Send Mail Through OE", "Sure, you can, Tom!", aRecips
End Sub


Re: sending emails from access through outlook express
Tony Toews <ttoews[ at ]telusplanet.net> 27.07.2006 18:40:49
"Sam" <focus10[ at ]zahav.net.il> wrote:

[Quoted Text]
>i found in http://www.granite.ab.ca/access/email/mapi.htm a code for sending
>emails from access through outlook express.

I'm a bit confused. There actually isn't any code of mine on that
page. There are links to other articles though. Which one did you
get the code from?

Ah, ok, I found the code you mention. Try the "Simple MAPI the API
set that has been around since Windows 95 to send mail. Supports
attachments, multiple recipients, and more! " link instead.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Re: sending emails from access through outlook express
"Sam" <focus10[ at ]zahav.net.il> 30.07.2006 08:25:05
thank you for the responed
but i don't know how to use the Simple MAPI with access
can you give me some directions?


"Tony Toews" <ttoews[ at ]telusplanet.net> wrote in message
news:m02ic2hr8m8enspiv086d3v9fmlitlt98j[ at ]4ax.com...
[Quoted Text]
> "Sam" <focus10[ at ]zahav.net.il> wrote:
>
>>i found in http://www.granite.ab.ca/access/email/mapi.htm a code for
>>sending
>>emails from access through outlook express.
>
> I'm a bit confused. There actually isn't any code of mine on that
> page. There are links to other articles though. Which one did you
> get the code from?
>
> Ah, ok, I found the code you mention. Try the "Simple MAPI the API
> set that has been around since Windows 95 to send mail. Supports
> attachments, multiple recipients, and more! " link instead.
>
> Tony
> --
> Tony Toews, Microsoft Access MVP
> Please respond only in the newsgroups so that others can
> read the entire thread of messages.
> Microsoft Access Links, Hints, Tips & Accounting Systems at
> http://www.granite.ab.ca/accsmstr.htm


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net