Author Topic: Remove path from email attachment name  (Read 3588 times)

prapa.shah

  • Newbie
  • *
  • Posts: 4
    • View Profile
Remove path from email attachment name
« on: September 24, 2012, 05:51:03 PM »
While sending mail with attachment  if you use forward slahses ('/') in path then it will show whole file path like 74.3.230.111/files/myfile.pdf into mail attachment.

Attachment att1 = new Attachment("////74.3.230.111/files/myfile.pdf ");
email.Attachments.Add(att1);

But if you use backslashes ('\') then it will show only file name in attachment like myfile.pdf
« Last Edit: September 24, 2012, 05:52:37 PM by prapa.shah »

Ritesh Shah

  • Administrator
  • Jr. Member
  • *****
  • Posts: 57
  • Ritesh Shah
    • View Profile
    • IT Technology Blog
Re: Remove path from email attachment name
« Reply #1 on: September 25, 2012, 04:00:12 PM »
Welcome to the community Prapa.... :) finally you have started community service.
Ritesh Shah
Administrator
Extreme-Advice.com
SQLHub.com