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

I

iambus

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:[email protected]">[email protected]</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 "(e-mail address removed)" 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:[email protected]. What should I do to solve this problem?

(My OS is WinXP.)

Thanks.
 
N

NoelByron

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
 
G

Gerold Penz

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:[email protected]?subject=Hello&body=World")


regards,
Gerold
:)


--
________________________________________________________________________
Gerold Penz - bcom - Programmierung
(e-mail address removed) | http://gerold.bcom.at | http://sw3.at
Ehrliche, herzliche Begeisterung ist einer der
wirksamsten Erfolgsfaktoren. Dale Carnegie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top