Discussion:
Howto active email client from wx30
Mauro Ziliani
2014-06-29 17:44:24 UTC
Permalink
Hi all.
I need to send an email from my application.

How can I prepare the email message, and send it to the default email
client of the system?

The app is cross-platform Linux/Windows.

Best regards,
Mauro
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Eric Jensen
2014-06-29 18:14:24 UTC
Permalink
Hello Mauro,

Sunday, June 29, 2014, 7:44:24 PM, you wrote:

MZ> Hi all.
MZ> I need to send an email from my application.

MZ> How can I prepare the email message, and send it to the default email
MZ> client of the system?

MZ> The app is cross-platform Linux/Windows.

MZ> Best regards,
MZ> Mauro

Under Windows, wxLaunchDefaultBrowser() with "mailto:" scheme works. I
haven't tried under Linux.

http://docs.wxwidgets.org/trunk/group__group__funcmacro__misc.html#ga3ff36fe489da2a779248b56f283615ca

Eric
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Mauro Ziliani
2014-07-11 07:45:52 UTC
Permalink
Thanks a lot.

MZ
Post by Eric Jensen
Hello Mauro,
MZ> Hi all.
MZ> I need to send an email from my application.
MZ> How can I prepare the email message, and send it to the default email
MZ> client of the system?
MZ> The app is cross-platform Linux/Windows.
MZ> Best regards,
MZ> Mauro
Under Windows, wxLaunchDefaultBrowser() with "mailto:" scheme works. I
haven't tried under Linux.
http://docs.wxwidgets.org/trunk/group__group__funcmacro__misc.html#ga3ff36fe489da2a779248b56f283615ca
Eric
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Mauro Ziliani
2014-08-25 23:13:57 UTC
Permalink
I'm back again.
I put my question incomplete.

When I need to prepare the message I have to
1. specify the address (one or more)
2. specify the subject
3. attach one or more files
4. put the body.

Can I do this using wxLaunchDefaultBrowser with a special arguments?

MZ
Post by Mauro Ziliani
Thanks a lot.
MZ
Post by Eric Jensen
Hello Mauro,
MZ> Hi all.
MZ> I need to send an email from my application.
MZ> How can I prepare the email message, and send it to the default email
MZ> client of the system?
MZ> The app is cross-platform Linux/Windows.
MZ> Best regards,
MZ> Mauro
Under Windows, wxLaunchDefaultBrowser() with "mailto:" scheme works. I
haven't tried under Linux.
http://docs.wxwidgets.org/trunk/group__group__funcmacro__misc.html#ga3ff36fe489da2a779248b56f283615ca
Eric
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Mauro Ziliani
2014-08-25 23:15:06 UTC
Permalink
The best choice for should be.

Prepare the email message with all data (addresses, subject, attachments,
body) and pass all to the default email browser.

MZ
Post by Mauro Ziliani
I'm back again.
I put my question incomplete.
When I need to prepare the message I have to
1. specify the address (one or more)
2. specify the subject
3. attach one or more files
4. put the body.
Can I do this using wxLaunchDefaultBrowser with a special arguments?
MZ
Post by Mauro Ziliani
Thanks a lot.
MZ
Post by Eric Jensen
Hello Mauro,
MZ> Hi all.
MZ> I need to send an email from my application.
MZ> How can I prepare the email message, and send it to the default email
MZ> client of the system?
MZ> The app is cross-platform Linux/Windows.
MZ> Best regards,
MZ> Mauro
Under Windows, wxLaunchDefaultBrowser() with "mailto:" scheme works. I
haven't tried under Linux.
http://docs.wxwidgets.org/trunk/group__group__funcmacro__misc.html#ga3ff36fe489da2a779248b56f283615ca
Eric
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Eric Jensen
2014-08-25 23:28:42 UTC
Permalink
Hello Mauro,

Tuesday, August 26, 2014, 1:13:57 AM, you wrote:

MZ> I'm back again.
MZ> I put my question incomplete.

MZ> When I need to prepare the message I have to
MZ> 1. specify the address (one or more)
MZ> 2. specify the subject
MZ> 3. attach one or more files
MZ> 4. put the body.

MZ> Can I do this using wxLaunchDefaultBrowser with a special arguments?

It is possible to set the receiver, subject and body with the URL:

For example:
mailto:***@somewhere.local?subject=wxWidgets%20Email&body=just%20another%20test

But to my best knowledge it's not possible to attach files this way.

And, i don't know if this is important for your task or not, the email
won't be sent automatically, it will just open an email in the user's
default email application. He will have to close and send it himself.

If you can ask the user for his email data (smpt-server, login etc),
you could also use a proper SMTP library to sent the email.

There is wxEmail for example:
http://forums.wxwidgets.org/viewtopic.php?f=10&t=33822&p=143233

And there are several other free or commercial alternatives.

Htj,
Eric
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Faresoftware.it
2014-08-26 08:31:09 UTC
Permalink
Thanks a lot. This is what I need.

I'd like allow to send the email by default email browser.
So the final user has all emails in his email browser (Outlook,
Thunderbird, ...)
And I don't need to maintain the list of the emails sent.

The last problem is how to attach a file

Thans again.

MZ
Post by Eric Jensen
Hello Mauro,
MZ> I'm back again.
MZ> I put my question incomplete.
MZ> When I need to prepare the message I have to
MZ> 1. specify the address (one or more)
MZ> 2. specify the subject
MZ> 3. attach one or more files
MZ> 4. put the body.
MZ> Can I do this using wxLaunchDefaultBrowser with a special arguments?
But to my best knowledge it's not possible to attach files this way.
And, i don't know if this is important for your task or not, the email
won't be sent automatically, it will just open an email in the user's
default email application. He will have to close and send it himself.
If you can ask the user for his email data (smpt-server, login etc),
you could also use a proper SMTP library to sent the email.
http://forums.wxwidgets.org/viewtopic.php?f=10&t=33822&p=143233
And there are several other free or commercial alternatives.
Htj,
Eric
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Václav Slavík
2014-08-26 08:31:35 UTC
Permalink
Hi,
Post by Eric Jensen
But to my best knowledge it's not possible to attach files this way.
1. There's a limit on the length of the URL (e.g. Outlook I think), it's only good for short emails.
2. Lots of people use Gmail and don't even have anything able to handle the mailto: protocol installed locally.

Regards,
Vaclav
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Faresoftware.it
2014-08-26 09:24:31 UTC
Permalink
Hi,
If the url is limited, making a multipart mime body to include an
attachment should not works.

I try any way

Now I have to prepare the email for Outlook 2013, but I'd like to do
some more general.
If I'm in trouble I have to use COM model for Windows :-(

MZ
Post by Václav Slavík
Hi,
Post by Eric Jensen
But to my best knowledge it's not possible to attach files this way.
1. There's a limit on the length of the URL (e.g. Outlook I think),
it's only good for short emails.
2. Lots of people use Gmail and don't even have anything able to
handle the mailto: protocol installed locally.
Regards,
Vaclav
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
or visit http://groups.google.com/group/wx-users
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Eric Jensen
2014-08-26 10:46:47 UTC
Permalink
Hello Faresoftware.it,

Tuesday, August 26, 2014, 11:24:31 AM, you wrote:

Fi> Hi,
Fi> If the url is limited, making a multipart mime body to include an
Fi> attachment should not works.

Fi> I try any way

Fi> Now I have to prepare the email for Outlook 2013, but I'd like to do
Fi> some more general.
Fi> If I'm in trouble I have to use COM model for Windows :-(

You could also look into an older wxWidgets component "smapi" which
was in the wx direcory under /contrib/net/ up to wxWidgets version
2.8.x. It uses MAPI for the mail transport. I guess it should
to possible to make it compile under wx 3.0.x with minimal changes.

Regards,
Eric
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
John Roberts
2014-08-26 09:23:35 UTC
Permalink
Post by Václav Slavík
Hi,
Post by Eric Jensen
But to my best knowledge it's not possible to attach files this way.
1. There's a limit on the length of the URL (e.g. Outlook I think),
it's only good for short emails.
2. Lots of people use Gmail and don't even have anything able to
handle the mailto: protocol installed locally.
Regards,
Vaclav
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
or visit http://groups.google.com/group/wx-users
Also I found I needed to use ?to= as below with OSX.
mailto:?to=***@address_or_empty&subject=My%20subject

OSX complained if I didn't add ?to= after mailto: and instead had the
question mark elsewhere e.g. ?subject=mysubject&body=mybody.
Windows accepted spaces in the subject and body but OSX rightly didn't
so you need to replace space characters.
I also use wxEmail for sending emails but haven't set it up to receive.
The version I used needed work to send attachments and also required
other work. If you want the user to edit the email before sending then
you will also need to build a user interface.

Regards, John
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Loading...