471,353 Members | 1,498 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,353 software developers and data experts.

How to insert an email-link into wxPython's HtmlWindow

Hello. I don't know if this topic is appropriate in this group (and my
English is not good).

My problem is here:

I created a HtmlWindow in wxPython, then I wrote some code and set it
to the page-text. In these code there was a line "<a
href="mailto:na**@gmail.com">na**@gmail.com</a>" (where "name" was my
real username). Then I showed this HtmlWindow and I thought there would
be a mail-sending box when I clicked on the "na**@gmail.com" link (like
when I clicked it in a web browser). But there just came a "Python
Error"-titled dialog: Unable to open requested HTML document
mailto:na**@gmail.com. What should I do to solve this problem?

(My OS is WinXP.)

Thanks.

Sep 6 '06 #1
3 1975
Override OnLinkClicked() and check the passed link info for the 'mail:'
prefix. And if its there, don't call the OnLinkClicked() method of the
base class, to prevent wxWidgets from loading this link as a HTML
ressource.

Now, you have reduced your problem to: how do I call the standard Email
client? I have no idea...
Have fun,
Noel

Sep 6 '06 #2
No*******@gmx.net schrieb:
Now, you have reduced your problem to: how do I call the standard Email
client? I have no idea...
Hi!

With Windows, you can use ``os.startfile()``:

import os
os.startfile("mailto:he***@world.at?subject=Hello& body=World")
regards,
Gerold
:-)
--
__________________________________________________ ______________________
Gerold Penz - bcom - Programmierung
ge*********@tirol.utanet.at | http://gerold.bcom.at | http://sw3.at
Ehrliche, herzliche Begeisterung ist einer der
wirksamsten Erfolgsfaktoren. Dale Carnegie
Sep 6 '06 #3

Thanks. It works now.

--Kneo

ia****@gmail.com wrote:
Hello. I don't know if this topic is appropriate in this group (and my
English is not good).

My problem is here:

I created a HtmlWindow in wxPython, then I wrote some code and set it
to the page-text. In these code there was a line "<a
href="mailto:na**@gmail.com">na**@gmail.com</a>" (where "name" was my
real username). Then I showed this HtmlWindow and I thought there would
be a mail-sending box when I clicked on the "na**@gmail.com" link (like
when I clicked it in a web browser). But there just came a "Python
Error"-titled dialog: Unable to open requested HTML document
mailto:na**@gmail.com. What should I do to solve this problem?

(My OS is WinXP.)

Thanks.
Sep 10 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by newbie_mw | last post: by
1 post views Thread by newbie_mw | last post: by
16 posts views Thread by Philip Boonzaaier | last post: by
6 posts views Thread by Maurizio Faini | last post: by
11 posts views Thread by Chris Fink | last post: by
20 posts views Thread by Mark Harrison | last post: by
6 posts views Thread by rn5a | last post: by
5 posts views Thread by =?Utf-8?B?bXBhaW5l?= | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.