Hi,

My code requires to send an email to list of people that satisfy certain conditions.
This email will in turn have a hyperlink to open another email,with subject and body pre populated.
When I try creating this hyperlink, i want the code to be hidden ie. i want to use html tags (href) so that the email looks fancy.
I want to use something like this -
<a href="' + bodyMail + '" >Click here to respond to user</a>

But when i use it in python, the email has the hyperlink, but it does not get displayed as "Click here to respond to user" instead it shows up like this -

<a href="mailto:?cc=pendingticketreminders%40warnerbros.com&Subject=Reminder%202%20for%20Incident%3A%20INC000000608498&Body=Dear%20%3A%0A%0AIncident%20Tickets%20%23%20INC000000608498%20assigned%20to%20support%20group%20WBEI%20Global%20Help%20Desk%20has%20been%20pending%20with%20status%20reason%20%27Client%20Action%20Required%27%20since%2012/23/2009%2020%3A29%0A%0AKindly%20send%20reminder%201%20to%20user%20to%20resolve%20this%20ticket.%0A%0AClick%20below%20to%20send%20the%20reminder%0A%0A%2A%2A%2A%20Please%20copy%20reminder%20to%20distribution%20list%20%2APending%20Ticket%20Reminders%20%2A%2A%2A" >Click here to respond to user</a>

Recommended Answers

All 5 Replies

In order to see a hyperlink you would need something that was capable of rendering HTML. Why don't you try opening the output from Python in your web browser

In order to see a hyperlink you would need something that was capable of rendering HTML. Why don't you try opening the output from Python in your web browser

Hi Jim,

The requirement is to open an email message window in outlook.
Is there no way Python can insert a hyperlink in an email?

From your first post, you've already indicated that you inserted the hyperlink into the email message

From your first post, you've already indicated that you inserted the hyperlink into the email message

Yes, the hyperlink is present , but I don't to show all the coding behind the hyperlink.
I want to say 'Click Here' and then the 'here' has the hyperlink.

Yes, the hyperlink is present , but I don't to show all the coding behind the hyperlink.
I want to say 'Click Here' and then the 'here' has the hyperlink.

Yes, the html for that would be:

Click <a href="http://www.google.com">Here</a>

However, in order for the hyperlink to display correctly you not only need a program or client that is capable of rendering HTML, you need to make sure you're creating proper HTML code. There are a number of ways to achieve this:

1) Save the output to an html file (.htm, .html) and open that file in a web browser (Internet Explorer, Firefox, Chrome)
2) Send the output in an email using something like SMTP library
3) Implement a GUI (like wxPython) that contains a rich text rendering module capable of displaying HTML

All of the above methods however require proper HTML formatting and syntax. In many cases you want to make sure you're inserting the proper headers, etc.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.