64-Bit Microsoft Outlook and Default Mail Clients
64-Bit Microsoft Outlook and Default Mail Clients
Hey there!
Just wondering if anyone uses their software to send out mail to the default mail client and whether you have a solution that works with 64-bit Office.
At the moment, we're using an older SOCMAPI.DLL that opens up the default mail client with all the proper subjects/attachments/bodies/addressees/etc., but this solution isn't working with the newer version of Outlook 64-bit it seems.
I'm reading the MarshallSoft SEE4XB email package, but I don't see that you can send out emails to the default mail client through the libraries.
Can anyone help out?
Thanks!
Sven
Just wondering if anyone uses their software to send out mail to the default mail client and whether you have a solution that works with 64-bit Office.
At the moment, we're using an older SOCMAPI.DLL that opens up the default mail client with all the proper subjects/attachments/bodies/addressees/etc., but this solution isn't working with the newer version of Outlook 64-bit it seems.
I'm reading the MarshallSoft SEE4XB email package, but I don't see that you can send out emails to the default mail client through the libraries.
Can anyone help out?
Thanks!
Sven
Re: 64-Bit Microsoft Outlook and Default Mail Clients
DC_SendMailToDefault( cTo, cCC, cSubject, cBody )
The eXpress train is coming - and it has more cars.
Re: 64-Bit Microsoft Outlook and Default Mail Clients
Thanks so much Roger, I'll test it out today.
Re: 64-Bit Microsoft Outlook and Default Mail Clients
Hey Roger,
Just got around to testing it.
I call:
And I get:
Any ideas?
Just got around to testing it.
I call:
Code: Select all
DC_SendMailToDefault( "test@test.com", "cc@test.com", "Hello", "Body" )
Any ideas?
Re: 64-Bit Microsoft Outlook and Default Mail Clients
hm ... it should work ...
try this
try this
Code: Select all
FUNCTION MailTo( cMailto, cSubject, cBody )
LOCAL cFile := "mailto:"+cMailto+;
" ?subject="+cSubject+;
" &body="+cBody
DllCall( "SHELL32.DLL" ,;
DLL_STDCALL, "ShellExecuteA", AppDesktop():getHWND(), "Open", cFile, Nil, Curdir(), SW_NORMAL )
RETURN .T.
greetings by OHR
Jimmy
Jimmy
Re: 64-Bit Microsoft Outlook and Default Mail Clients
It works for me.
I'm running Win 7 64-bit, with Outlook.
I'm running Win 7 64-bit, with Outlook.
The eXpress train is coming - and it has more cars.
Re: 64-Bit Microsoft Outlook and Default Mail Clients
Thanks Roger, it works with Outlook (but not with Thunderbird for some reason).
But I have one extra wrench in the problem:
I need to be able to attach files to the email as well. Any ideas?
But I have one extra wrench in the problem:
I need to be able to attach files to the email as well. Any ideas?
Re: 64-Bit Microsoft Outlook and Default Mail Clients
As you see in the below code, DC_SendMailToDefault() uses the FileProtocolHandler mailto: feature of Url.dll.
Unfortunately it does not support attachments.
There is probably a better way to do what you want.
You could use Alaska's SmtpClient() to send out emails directly through your mail provider.
Look at the sendmail.prg sample in \exp20\samples\asinet.
Unfortunately it does not support attachments.
There is probably a better way to do what you want.
You could use Alaska's SmtpClient() to send out emails directly through your mail provider.
Look at the sendmail.prg sample in \exp20\samples\asinet.
Code: Select all
FUNCTION DC_SendMailToDefault( cTo, cCC, cSubject, cBody )
LOCAL cParams, cCommand
cParams := 'url.dll,FileProtocolHandler mailto:'
IF !Empty(cTo)
// cParams += '?to=' + cTo
cParams += cTo
ENDIF
IF !Empty(cCC)
cParams += Chr(38) + 'cc=' + cCC
ENDIF
IF !Empty(cSubject)
cParams += Chr(38) + 'subject=' + cSubject
ENDIF
IF !Empty(cBody)
cBody := Strtran(cBody,Chr(13),'%0d')
cBody := Strtran(cBody,Chr(10),'%0a')
cBody := Strtran(cBody,' ','%20')
cBody := Strtran(cBody,Chr(38),'%26')
cBody := Strtran(cBody,'?','%3f')
cBody := Strtran(cBody,'=','%3d')
cParams += Chr(38) + 'body=' + cBody
ENDIF
cCommand := 'Rundll32.exe'
RunShell( cParams, cCommand, .t., .t. )
RETURN nil
The eXpress train is coming - and it has more cars.
Re: 64-Bit Microsoft Outlook and Default Mail Clients
Thanks Roger.
Unfortunately, I need to use MAPI to send it out (for various reasons outside of my control).
However, I'm just gonna use your DC_REG* functions to confirm that a 64-bit Outlook is running, and if so, run the Outlook with the command line:
That's a good workaround for me.
Thanks!
Unfortunately, I need to use MAPI to send it out (for various reasons outside of my control).
However, I'm just gonna use your DC_REG* functions to confirm that a 64-bit Outlook is running, and if so, run the Outlook with the command line:
Code: Select all
OUTLOOK.EXE /c ipm.note /a c:\attach.txt /m "sven@email.com;other@email.com &cc=other2@email.com &bcc=other3@email.com &subject=abc &body=Blah"
That's a good workaround for me.
Thanks!
Re: 64-Bit Microsoft Outlook and Default Mail Clients
Hello,
I have can send mails with OT4XB and MAPI, if neede I can post sample code here
reagards
Rudolf
I have can send mails with OT4XB and MAPI, if neede I can post sample code here
reagards
Rudolf