Holger
IS-IT--Management
- May 18, 2001
- 9
I sat there on a problem with Netscape Mail. I automatically create mails using ShellExecute:
=================
Public Function OpenEmail(ByVal EmailAddress As String, _
Optional Subject As String, Optional Body As String) As Boolean
Dim lWindow As Long
Dim lRet As Long
Dim sParams As String
sParams = EmailAddress
If LCase(Left(sParams, 7)) <> "mailto:" Then _
sParams = "mailto:" & sParams
If Subject <> "" Then sParams = sParams & "?subject=" & Subject
If Body <> "" Then
sParams = sParams & IIf(Subject = "", "?", "&"
sParams = sParams & "body=" & Body
End If
lRet = ShellExecute(lWindow, "open", sParams, _
vbNullString, vbNullString, SW_SHOW)
OpenEmail = lRet = 0
End Function
=============================
It works fine but - it doesn't accept any linefeed in the body (vbcrlf, vbcr, vblf, chr(10), chr(13)) if the mail is created in Netscape Mail. But I must set linefeeds! How to do that??? Who knows?
=================
Public Function OpenEmail(ByVal EmailAddress As String, _
Optional Subject As String, Optional Body As String) As Boolean
Dim lWindow As Long
Dim lRet As Long
Dim sParams As String
sParams = EmailAddress
If LCase(Left(sParams, 7)) <> "mailto:" Then _
sParams = "mailto:" & sParams
If Subject <> "" Then sParams = sParams & "?subject=" & Subject
If Body <> "" Then
sParams = sParams & IIf(Subject = "", "?", "&"
sParams = sParams & "body=" & Body
End If
lRet = ShellExecute(lWindow, "open", sParams, _
vbNullString, vbNullString, SW_SHOW)
OpenEmail = lRet = 0
End Function
=============================
It works fine but - it doesn't accept any linefeed in the body (vbcrlf, vbcr, vblf, chr(10), chr(13)) if the mail is created in Netscape Mail. But I must set linefeeds! How to do that??? Who knows?