Sending an E-mail Topic is solved
Sending an E-mail
How can I programmatically make the system open up a new e-mail message to a specified address?
In other words, I want to achieve the same functionality as when you click an e-mail link on a web site, but from within my program.
Thanks for the help.
In other words, I want to achieve the same functionality as when you click an e-mail link on a web site, but from within my program.
Thanks for the help.
Well, there many ways to get to Rome
One would be, to do it over smtp.
Therefore, you would need a SMTP Server, or bring your own withyou.
Guess you have somewhere one, than, you only need a SMTP Class,
which does the sending for you. In Java, Java Mail API does this,
i don't know if wx offers something similary...
One would be, to do it over smtp.
Therefore, you would need a SMTP Server, or bring your own withyou.
Guess you have somewhere one, than, you only need a SMTP Class,
which does the sending for you. In Java, Java Mail API does this,
i don't know if wx offers something similary...
I want to achieve the same functionality as when you click an e-mail link on a web site, but from within my program. i.e. a new message opens up with the user's default e-mail program.
I don't want to do any sending at all. Just open a new mail message. This should be some permutation of wxExecute or ShellExecute.
I don't want to do any sending at all. Just open a new mail message. This should be some permutation of wxExecute or ShellExecute.
Got it! Finally figured it out. Note this works on Windows only!
Code: Select all
void SendEmail(wxString addy) {
wxString sendTo = "mailto:";
sendTo += addy;
ShellExecute(NULL,"open", sendTo.c_str(), "", "", 0);
}
Last edited by Tyler on Sun Aug 28, 2005 1:47 pm, edited 1 time in total.
-
- Earned some good credits
- Posts: 109
- Joined: Fri Sep 03, 2004 9:30 am
- Location: Brescia, Italy
In other words, you want the same behaviour of a browser, when you click on a URL like: mailto:[email protected]Tyler wrote:I want to achieve the same functionality as when you click an e-mail link on a web site, but from within my program. i.e. a new message opens up with the user's default e-mail program.
If the wxHTML widget handles this type of URL, maybe a little investigation into the wx sources will show the answer.
Edit: ok, I was too slow typing
Sandro Sigala - Kynosoft, Brescia
-
- Experienced Solver
- Posts: 75
- Joined: Sat Dec 10, 2005 10:38 pm
- Location: Michigan, USA
- Contact:
Is there a way to do this correctly for Linux and Windows. ShellExecute is only available on Windows I think. Is there a file type for the mime type manager in Linux and Windows for email?
Thanks.
Thanks.
- Ryan
RJP Computing
wxPack - Precompiled wxWidgets package.
Ubuntu 9.04 x86_64/WinXP, AMD Athlon x2 3000+, 4000MB RAM, AC 97 Audio, nVidia GeForce 9400GS 1GB
RJP Computing
wxPack - Precompiled wxWidgets package.
Ubuntu 9.04 x86_64/WinXP, AMD Athlon x2 3000+, 4000MB RAM, AC 97 Audio, nVidia GeForce 9400GS 1GB
-
- Earned some good credits
- Posts: 132
- Joined: Mon Apr 04, 2005 12:54 am
- Location: California
- Contact:
Hi,
Get the default browser. wxGetDefaultBrowser or something and then open mailto:[email protected]
that should work
Get the default browser. wxGetDefaultBrowser or something and then open mailto:[email protected]
that should work
I see said the blind man to the deaf girl who was mute.
Visit my project at: http://vwp.sourceforge.net
wx version:2.6.2 and 2.6.3 on linux
OS's:Windows XP, Gentoo is the best!!!!!!
compiler:Codeblocks(MingW32) and gcc on linux
Visit my project at: http://vwp.sourceforge.net
wx version:2.6.2 and 2.6.3 on linux
OS's:Windows XP, Gentoo is the best!!!!!!
compiler:Codeblocks(MingW32) and gcc on linux
-
- Experienced Solver
- Posts: 75
- Joined: Sat Dec 10, 2005 10:38 pm
- Location: Michigan, USA
- Contact:
Well I can't seem to find anything on wxGetDefaultBrowser function. Second it will open the browser to a blank page before opening the email. This seems hacky. I am looking for the same functionality as Windows 'ShellExecute' mailto:[email protected]. In Windows it doesn't open the browser, just the email window.
Is there a cross platform version of ShellExecute?
Is there a cross platform version of ShellExecute?
- Ryan
RJP Computing
wxPack - Precompiled wxWidgets package.
Ubuntu 9.04 x86_64/WinXP, AMD Athlon x2 3000+, 4000MB RAM, AC 97 Audio, nVidia GeForce 9400GS 1GB
RJP Computing
wxPack - Precompiled wxWidgets package.
Ubuntu 9.04 x86_64/WinXP, AMD Athlon x2 3000+, 4000MB RAM, AC 97 Audio, nVidia GeForce 9400GS 1GB
-
- Experienced Solver
- Posts: 75
- Joined: Sat Dec 10, 2005 10:38 pm
- Location: Michigan, USA
- Contact:
Are there any other suggestions? I would like to be able to do this in Linux as professional as it can be done in Windows.
- Ryan
RJP Computing
wxPack - Precompiled wxWidgets package.
Ubuntu 9.04 x86_64/WinXP, AMD Athlon x2 3000+, 4000MB RAM, AC 97 Audio, nVidia GeForce 9400GS 1GB
RJP Computing
wxPack - Precompiled wxWidgets package.
Ubuntu 9.04 x86_64/WinXP, AMD Athlon x2 3000+, 4000MB RAM, AC 97 Audio, nVidia GeForce 9400GS 1GB
- Ryan Norton
- wxWorld Domination!
- Posts: 1319
- Joined: Mon Aug 30, 2004 6:01 pm
I think he means wxLaunchDefaultBrowser....RJP Computing wrote:Well I can't seem to find anything on wxGetDefaultBrowser function. Second it will open the browser to a blank page before opening the email. This seems hacky. I am looking for the same functionality as Windows 'ShellExecute' mailto:[email protected]. In Windows it doesn't open the browser, just the email window.
Is there a cross platform version of ShellExecute?
[Mostly retired moderator, still check in to clean up some stuff]
-
- Experienced Solver
- Posts: 75
- Joined: Sat Dec 10, 2005 10:38 pm
- Location: Michigan, USA
- Contact:
I actually tried this and it doesn't work either. Any other sugestions.Ryan Norton wrote:I think he means wxLaunchDefaultBrowser....
Is there a default file extension for email on linux?
Last edited by RJP Computing on Thu Jan 26, 2006 1:34 pm, edited 1 time in total.
- Ryan
RJP Computing
wxPack - Precompiled wxWidgets package.
Ubuntu 9.04 x86_64/WinXP, AMD Athlon x2 3000+, 4000MB RAM, AC 97 Audio, nVidia GeForce 9400GS 1GB
RJP Computing
wxPack - Precompiled wxWidgets package.
Ubuntu 9.04 x86_64/WinXP, AMD Athlon x2 3000+, 4000MB RAM, AC 97 Audio, nVidia GeForce 9400GS 1GB
- Ryan Norton
- wxWorld Domination!
- Posts: 1319
- Joined: Mon Aug 30, 2004 6:01 pm
either .eml or .mbox - I'd try using wxMimeTypesManager to get the default application's path then launch it with wxExecuteRJP Computing wrote:I actually tried this and it doesn't work either. Any other sugestions.Ryan Norton wrote:I think he means wxLaunchDefaultBrowser....
Is there a default file extension for email on linux?
[Mostly retired moderator, still check in to clean up some stuff]
-
- Knows some wx things
- Posts: 38
- Joined: Wed Aug 02, 2006 4:59 am