Welcome! Log In Create A New Profile

Advanced

How do you send an Email through Outlook (from WinDev) ...

Posted by Dan M 
I have created a button... "Send Email". the code is ...

EmailString = " C:\Program Files\Microsoft Office\Office11\Outlook.exe mailto: " + contacts.email_address + " &subject=Introduction &body=Thank .."

EDT_Edit1 = EmailString

CommandLine(EmailString)

//ExeRun(EmailString)


When then button is clicked, it creates the following string ...

mailto: dpmatis@componentsplus.net &subject=Introduction &body=Thank ..

When I past it into Start > Run > ... it fires up outlook and creates the email, all it is waiting for is the "send button"

BUT from WinDev it does nothing????

I have tried putting the string in ExeRun & CommandLine with no success ?

How do I get this to fire up in WinDev??
Hello Dan

Try ShellExecute("mailto: " + contacts.email_address + " &subject=Introduction &body=Thank .." )

Shellexecute() may probably preferable in an app because it will use the default mail client

Which version of Outlook are you running ? I am having problems with Outlook 2007 and Windev using mailto:

There is an alternative process using the email commands EmailStartSMTPSession etc
See the "SendMail.wdw" in the crm example

Regards
Al

Al,

Nothing from ShellExecute ...

I am using MicroSoft Office Outlook 2003

I just do not understand ...

I was able to get Skype to make outbound calls using ...

------------------------------------------------------------------------------

PROCEDURE DialPhoneNumber(sNumberToDial)

sCallToMake is a string
sCallToMake = "C:\Program Files\Skype\Phone\Skype /callto:+1" + sNumberToDial
ExeRun(sCallToMake)

-------------------------------------------------------------------------------
ExeRun worked fine here ... ?????????

I am going to start tackling the example you recommended in the CRM tomorrow.

I've been at this today since 8am, our time, so 20 hours is enough!

It's pillow time !

Thanks again for all your help and feedback !!

Dan
Hello Dan

This site has some mailto: syntax examples
[www.ianr.unl.edu]
" " (beginning and ending double quotes) are necessary if any spaces are used
Mailto parameter should be preceded by "?" for the first or only parameter and "&" for second and subsequent parameter.

Your code example had &Subject and &Body.
According to the website it should have been ?Subject and &Body


This is the code that I use
ShellExecute("mailto:"+NoSpace(SendToEmail)+"?subject="+NoteTopic+"&body="+RTFToText(Edit1))

Regards
Al
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: