🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #49364

Re: MAPISendMail / Post to a Newsgroup

#49364
From: Lyle Fairfield
Date: Sun, 10 Dec 2000 23:31
150 lines
4736 bytes
Actually I would want to do this, else OE seems to interpret the 
first zero it comes to as end of string and so I send it to a 
one letter address of "s".

Perhaps, you would like to try it:

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 MAPIFileTag
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), "@") <> 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:lylefair@yahoo.com"
    SendMailWithOE "Test", Format(Now(), "yyyy-mm-dd hh:nn"), 
aRecips
End Sub



"michael \(michka\) kaplan"
<former_mvp@nospam.trigeminal.spamfree.com> wrote in
<t3837ukr5gj3a1@corp.supernews.com>: 

>Also, you would not want to do this StrConv trick with the
>call, anyway. 
>
>--
>MichKa
>
>a new book on internationalization in VB at
>http://www.i18nWithVB.com/
>
>"michael (michka) kaplan"
><former_mvp@nospam.trigeminal.spamfree.com> wrote in message
>news:t2n2tn369a5caf@corp.supernews.com... 
>> MAPISendMail (simple MAPI) does not support the NNTP
>> protocol. 
>>
>> --
>> MichKa
>>
>> a new book on internationalization in VB at
>> http://www.i18nWithVB.com/
>>
>> "Lyle Fairfield" <lylefair@yahoo.com> wrote in message
>> news:90004DFD0lylefairyahoocom@24.2.9.58...
>> > Can I use MAPISendMail to post to a newsgroup?
>> >
>> > Currently I am using the address included below. A
>> > message sent to this 
>> address
>> > seems to go somewhere, as it is not returned and does the
>> > Mail Admin 
>does
>> not
>> > generate an error response (which happens for other
>> > addresses): 
>> >
>> > With Recipient(0)
>> >     .RecipClass = 1
>> >      .Address = StrConv("nntp://comp.databases.ms-
>> > access@news1.rdc2.pa.home.com", vbFromUnicode)
>> > End With
>> >
>> > --
>> > Lyle
>> > http://www.cyriv.com/
>>
>>
>
>
>


-- 
Lyle
http://www.cyriv.com/
Technical Details
Message-ID: <Xns9006B3BF6lylefairyahoocom@24.2.9.58>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!newsfeed.direct.ca!look.ca!newshub2.rdc1.sfba.home.com!news.home.com!news4.rdc1.on.home.com.POSTED!not-for-mail
References: <90004DFD0lylefairyahoocom@24.2.9.58> <t2n2tn369a5caf@corp.supernews.com> <t3837ukr5gj3a1@corp.supernews.com>

Show Full Headers
Complete Article Headers
Message-ID: <Xns9006B3BF6lylefairyahoocom@24.2.9.58>
Subject: Re: MAPISendMail / Post to a Newsgroup
Date: Sun, 10 Dec 2000 23:31:18 GMT
From: lylefair@yahoo.com (Lyle Fairfield)
References: <90004DFD0lylefairyahoocom@24.2.9.58> <t2n2tn369a5caf@corp.supernews.com> <t3837ukr5gj3a1@corp.supernews.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!newsfeed.direct.ca!look.ca!newshub2.rdc1.sfba.home.com!news.home.com!news4.rdc1.on.home.com.POSTED!not-for-mail
Newsgroups: news.software.nntp,comp.databases.ms-access
User-Agent: Xnews/03.11.14
Lines: 149
NNTP-Posting-Host: 24.226.64.223
X-Complaints-To: abuse@home.net
X-Trace: news4.rdc1.on.home.com 976491078 24.226.64.223 (Sun, 10 Dec 2000 15:31:18 PST)
NNTP-Posting-Date: Sun, 10 Dec 2000 15:31:18 PST
Organization: Excite@Home - The Leader in Broadband http://home.com/faster