6
Answers

Failed to map the path '/images/fb.gif'

narasiman rao

narasiman rao

8y
584
1
 My code as follows

Attachment imgAtt1 = new Attachment(Server.MapPath("\\images\\fb.gif"));
Attachment imgAtt2 = new Attachment(Server.MapPath("\\images\\twiter.gif"));

imgAtt1.ContentId = "\\images\\fb.gif";
imgAtt2.ContentId = "\\images\\twiter.gif";

mailmess.To.Clear();
smtpserver.Send(mailmess);
mailmess.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
mailmess.Dispose();

When i run the above code shows error as follows

Failed to map the path '/images/fb.gif'

The above error shows in below line as follows

Attachment imgAtt1 = new Attachment(Server.MapPath("\\images\\fb.gif"));

please help me what is the mistake i made.
  
Answers (6)