Thread View: news.software.nntp
9 messages
9 total messages
Started by Lyle Fairfield
Mon, 04 Dec 2000 00:00
MAPISendMail / Post to a Newsgroup
Author: Lyle Fairfield
Date: Mon, 04 Dec 2000 00:00
Date: Mon, 04 Dec 2000 00:00
17 lines
1265 bytes
1265 bytes
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/
Re: MAPISendMail / Post to a Newsgroup
Author: michael (michka) kaplan
Date: Mon, 04 Dec 2000 00:00
Date: Mon, 04 Dec 2000 00:00
31 lines
1552 bytes
1552 bytes
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/
Re: MAPISendMail / Post to a Newsgroup
Author: michael (michka) kaplan
Date: Sun, 10 Dec 2000 23:08
Date: Sun, 10 Dec 2000 23:08
43 lines
2060 bytes
2060 bytes
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/
>
>
Re: MAPISendMail / Post to a Newsgroup
Author: Lyle Fairfield
Date: Sun, 10 Dec 2000 23:31
Date: Sun, 10 Dec 2000 23:31
150 lines
4736 bytes
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/
Re: MAPISendMail / Post to a Newsgroup
Author: michael (michka) kaplan
Date: Mon, 11 Dec 2000 12:59
Date: Mon, 11 Dec 2000 12:59
201 lines
6692 bytes
6692 bytes
Well, since you should never be using MAPISendMail from a provider-specific
DLL, that could be the other problem?
But lets ignore that for a moment. :-)
I will explain what is wrong with this approach to handling Unicode strings.
Pretend that I were sending your name to the dll. VBA stores the string as
Unicode, thus:
L0y0l0e0
(zeros mean null zero). When you do the StrConv call, VBA makes a
MultiByteToWideChar call on your behalf via CP_ACP and you make it
L000y000l000e000
This is of course not something found in nature.... Double Unicode? Sounds
like a Animal housish "Double-secret Unicode?" You pass this to the API, and
VBA obligingly converts it back via WideCharToMultiByte to:
L0y0l0e0
So, no harm done, right? You just needlessly copied some strings? Leaving
aside the negative perf implications, lets pretend that your name contained
some Kanji in it, because you were Japanese. On your Japanese machine, it
turns out that some of the characters that show up in "double-secret
Unicode" are illegal and replaced by question marks. You end up sending
along
L0?0?0e0
and then of course chaos erupts, the earth turns a bit slower, and we all
fall off the planet since we do not slow down any. :-)
StrConv should never be used that way. Hell, you should not even use byte
arrays.
You can see this issue described in my book, or if you are a consciencious
objector to the idea of me making money (and some people are!) then Matt
Curland also covers this topic in his excellent book.
--
MichKa
a new book on internationalization in VB at
http://www.i18nWithVB.com/
"Lyle Fairfield" <lylefair@yahoo.com> wrote in message
news:Xns9006B3BF6lylefairyahoocom@24.2.9.58...
> 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/
Re: MAPISendMail / Post to a Newsgroup
Author: Lyle Fairfield
Date: Mon, 11 Dec 2000 13:40
Date: Mon, 11 Dec 2000 13:40
225 lines
8064 bytes
8064 bytes
Michael
I'm quite willing to accept the notion that there could be
addressing problems in this procedure with other than ANSI
character sets.
But the issue here was or is:
Can we send mail from Access with OE, regardless of our default
mail client? Some people have asserted that this cannot be done.
I think I can say that I can, as I have done so, and am willing
to do so to anyone who doubts this.
The addressing does not accept the address string unless it is
converted from Unicode, or rather it accepts it but truncates it
to one character, the "s" in "smtp". If there is another way to
induce the procedure to use the address, I would be glad to know
it.
As for, "you should never be using MAPISendMail from a provider-
specific DLL", I expect that you are right, but that was,
essentially, the problem. Would I ever use this myself? I doubt
it. Outlook and CDO seem to provide easier and more efficient
avenues for this.
"michael \(michka\) kaplan"
<former_mvp@nospam.trigeminal.spamfree.com> wrote in
<t39jvdcpku0sa5@corp.supernews.com>:
>Well, since you should never be using MAPISendMail from a
>provider-specific DLL, that could be the other problem?
>
>But lets ignore that for a moment. :-)
>
>I will explain what is wrong with this approach to handling
>Unicode strings. Pretend that I were sending your name to the
>dll. VBA stores the string as Unicode, thus:
>
>L0y0l0e0
>
>(zeros mean null zero). When you do the StrConv call, VBA
>makes a MultiByteToWideChar call on your behalf via CP_ACP
>and you make it
>
>L000y000l000e000
>
>This is of course not something found in nature.... Double
>Unicode? Sounds like a Animal housish "Double-secret
>Unicode?" You pass this to the API, and VBA obligingly
>converts it back via WideCharToMultiByte to:
>
>L0y0l0e0
>
>So, no harm done, right? You just needlessly copied some
>strings? Leaving aside the negative perf implications, lets
>pretend that your name contained some Kanji in it, because
>you were Japanese. On your Japanese machine, it turns out
>that some of the characters that show up in "double-secret
>Unicode" are illegal and replaced by question marks. You end
>up sending along
>
>L0?0?0e0
>
>and then of course chaos erupts, the earth turns a bit
>slower, and we all fall off the planet since we do not slow
>down any. :-)
>
>StrConv should never be used that way. Hell, you should not
>even use byte arrays.
>
>You can see this issue described in my book, or if you are a
>consciencious objector to the idea of me making money (and
>some people are!) then Matt Curland also covers this topic in
>his excellent book.
>
>--
>MichKa
>
>a new book on internationalization in VB at
>http://www.i18nWithVB.com/
>
>"Lyle Fairfield" <lylefair@yahoo.com> wrote in message
>news:Xns9006B3BF6lylefairyahoocom@24.2.9.58...
>> 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/
Re: MAPISendMail / Post to a Newsgroup
Author: michael (michka) kaplan
Date: Tue, 12 Dec 2000 07:45
Date: Tue, 12 Dec 2000 07:45
241 lines
8867 bytes
8867 bytes
Well, there is a good way to make Unicode calls, a deprecated way, and a bad
way. You chose the bad way. :-)
With that said, I would proceed and do it the right way.... make the string
params longs and then use StrPtr() of the strings for the long to pass.
--
MichKa
a new book on internationalization in VB at
http://www.i18nWithVB.com/
"Lyle Fairfield" <lylefair@yahoo.com> wrote in message
news:Xns90075F915lylefairyahoocom@24.2.9.58...
> Michael
>
> I'm quite willing to accept the notion that there could be
> addressing problems in this procedure with other than ANSI
> character sets.
>
> But the issue here was or is:
> Can we send mail from Access with OE, regardless of our default
> mail client? Some people have asserted that this cannot be done.
> I think I can say that I can, as I have done so, and am willing
> to do so to anyone who doubts this.
>
> The addressing does not accept the address string unless it is
> converted from Unicode, or rather it accepts it but truncates it
> to one character, the "s" in "smtp". If there is another way to
> induce the procedure to use the address, I would be glad to know
> it.
>
> As for, "you should never be using MAPISendMail from a provider-
> specific DLL", I expect that you are right, but that was,
> essentially, the problem. Would I ever use this myself? I doubt
> it. Outlook and CDO seem to provide easier and more efficient
> avenues for this.
>
> "michael \(michka\) kaplan"
> <former_mvp@nospam.trigeminal.spamfree.com> wrote in
> <t39jvdcpku0sa5@corp.supernews.com>:
>
> >Well, since you should never be using MAPISendMail from a
> >provider-specific DLL, that could be the other problem?
> >
> >But lets ignore that for a moment. :-)
> >
> >I will explain what is wrong with this approach to handling
> >Unicode strings. Pretend that I were sending your name to the
> >dll. VBA stores the string as Unicode, thus:
> >
> >L0y0l0e0
> >
> >(zeros mean null zero). When you do the StrConv call, VBA
> >makes a MultiByteToWideChar call on your behalf via CP_ACP
> >and you make it
> >
> >L000y000l000e000
> >
> >This is of course not something found in nature.... Double
> >Unicode? Sounds like a Animal housish "Double-secret
> >Unicode?" You pass this to the API, and VBA obligingly
> >converts it back via WideCharToMultiByte to:
> >
> >L0y0l0e0
> >
> >So, no harm done, right? You just needlessly copied some
> >strings? Leaving aside the negative perf implications, lets
> >pretend that your name contained some Kanji in it, because
> >you were Japanese. On your Japanese machine, it turns out
> >that some of the characters that show up in "double-secret
> >Unicode" are illegal and replaced by question marks. You end
> >up sending along
> >
> >L0?0?0e0
> >
> >and then of course chaos erupts, the earth turns a bit
> >slower, and we all fall off the planet since we do not slow
> >down any. :-)
> >
> >StrConv should never be used that way. Hell, you should not
> >even use byte arrays.
> >
> >You can see this issue described in my book, or if you are a
> >consciencious objector to the idea of me making money (and
> >some people are!) then Matt Curland also covers this topic in
> >his excellent book.
> >
> >--
> >MichKa
> >
> >a new book on internationalization in VB at
> >http://www.i18nWithVB.com/
> >
> >"Lyle Fairfield" <lylefair@yahoo.com> wrote in message
> >news:Xns9006B3BF6lylefairyahoocom@24.2.9.58...
> >> 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/
Re: MAPISendMail / Post to a Newsgroup
Author: Lyle Fairfield
Date: Tue, 12 Dec 2000 10:56
Date: Tue, 12 Dec 2000 10:56
33 lines
2200 bytes
2200 bytes
Although I regularly do what you suggest in calling API
functions, I am unable to do so successfully in setting the
value of an elemennt of a type.
Type MAPIRecip
Reserved As Long
RecipClass As Long
Name As String
Address As String
EIDSize As Long
EntryID As String
End Type
I think you want me to set the value of MAPIRecip.Address to a
long (pointer). Whether MAPIRecip is typed as long or as string,
OE trys to send mail to the first decimal digit of the strPtr
... usually 4.
"michael \(michka\) kaplan"
<former_mvp@nospam.trigeminal.spamfree.com> wrote in
<t3blt491060q44@corp.supernews.com>:
>Well, there is a good way to make Unicode calls, a deprecated
>way, and a bad way. You chose the bad way. :-)
>
>With that said, I would proceed and do it the right way....
>make the string params longs and then use StrPtr() of the
>strings for the long to pass.
--
Lyle
http://www.cyriv.com/
Re: MAPISendMail / Post to a Newsgroup
Author: michael (michka) kaplan
Date: Wed, 13 Dec 2000 02:02
Date: Wed, 13 Dec 2000 02:02
46 lines
2522 bytes
2522 bytes
You could also try sending VarPtr() of the structure overall if you are having trouble getting the string pointer to work. -- MichKa a new book on internationalization in VB at http://www.i18nWithVB.com/ "Lyle Fairfield" <lylefair@yahoo.com> wrote in message news:Xns900833517lylefairyahoocom@24.2.9.58... > Although I regularly do what you suggest in calling API > functions, I am unable to do so successfully in setting the > value of an elemennt of a type. > > Type MAPIRecip > Reserved As Long > RecipClass As Long > Name As String > Address As String > EIDSize As Long > EntryID As String > End Type > > I think you want me to set the value of MAPIRecip.Address to a > long (pointer). Whether MAPIRecip is typed as long or as string, > OE trys to send mail to the first decimal digit of the strPtr > ... usually 4. > > "michael \(michka\) kaplan" > <former_mvp@nospam.trigeminal.spamfree.com> wrote in > <t3blt491060q44@corp.supernews.com>: > > >Well, there is a good way to make Unicode calls, a deprecated > >way, and a bad way. You chose the bad way. :-) > > > >With that said, I would proceed and do it the right way.... > >make the string params longs and then use StrPtr() of the > >strings for the long to pass. > > -- > Lyle > http://www.cyriv.com/
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads