0

I'm using following code to send an email to a team which contains hyperlink to the file, and hyperlink is path on network drive.

import win32com.client as win32
Path = '\\rsc.allnd.com\qdrive\shared'
mail = outlook.CreateItem(0)
mail.To = 'mymail@gmail.com'
mail.subject = 'subject'
mail.HTMLBody = "Hi all please find the 
Path to file below \n"\
f"<a href={path}>{path}<a/>"
mail.send()

But when I click the link in sent mail It is redirecting to browser and trying to open the path in it. How to make it to open in file explorer ?

Scarface
  • 359
  • 2
  • 13

1 Answers1

1

added file:// at beginning of path.

f"<a href=file://{path}>{path}<a/>

Above change made the link to open in file explorer.

Scarface
  • 359
  • 2
  • 13