I have two problems to solve which involves emailing and Facebook message.
Do you need an email application installed on your machine before you can email someone with the examples here on this forum?
I tried them with the "mailto" but nothing happened.
I think most people use web mail now, as I do, so I experimented with my Yahoo web mail and found this:
If I go to my "Compose" page (for a new email) and copy the web link, I can use the SYSTEM "bla bla bla" command to open a new email page in Yahoo (where "bla bla bla" is the link to my compose page).
On the program I'm working on now I will have an email button and a field next to it where the email address is stored.
So when this button is clicked, I could copy the email address to the clipboard, use SYSTM "bla bla bla" to pull up Yahoo, and finally copy the email address in for the recipient.
That will work, or am I making it hard work?
Has anyone tried sending a message to a Facebook user programatically? (sorry useless at spelling).
I presume you would need to be logged in to FB to do it?
I would use the last suggestion.
ShellExecuteA(0,"open","mailto:" + sEmailAddress, 0, 0, 1)
In theory (we already know how unpredictable Windows can be) MailTo is a command that receives the default browser declared in default app settings. Chrome, for example, can ignore this command according to an user-defined variable. On the other hand, ShellExecute + "Open" is a command that goes directly to the OS Shell and it should (!) always work... Just in case, remember that it is a COM function and you need to call CoInitialize/CoUninitialize.
Thanks guys, but I don't have a default email program.
So what do I do, or am I missing the obvious? ???
Okay, this works:
ShellExecuteA(0,"open","mailto:" + "email@example.com" + "?subject=Hi", 0, 0, 1)
But you still need an email client on your machine.
I think that if you or one of your customers does not have a default email application there is not much that can be done. Maybe you can check the return value from ShellExecute.
Far from ideal, but you can check the browser that comes in the sample codes. Edit the address to something like ATTACHBROWSER(wb, "mailto: Name@Example.com") and see what happens. If it works, you could create a hidden browser for this purpose.
Edit. Here's some additional info about this
Thanks every one!
So any thoughts on Facebook? and how to send a message / email to a FB user?
I don't do FB.
Andy, I found this:
Determine the contact's Facebook address. You can check if the contact has sent you the address to use. Otherwise, you can navigate to the user's Facebook timeline and locate their public username at the end of their URL. For example, for the URL "http://facebook.com/user" the public username would be "user." This public username is the first part of the Facebook email address, so the email address would be "firstname.lastname@example.org."
Thanks for that, I took a little while to read up on what you've mentioned, and I think that is the way to do it, i.e. send a message via email.