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.
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.

Malvik BhavsarRank #617 · 3.9K reputationPosted Jan 17, 2016, 6:15 PM EST
Attachment imgAtt2 = new Attachment(Server.MapPath("~\images\twiter.gif"));
Rajeesh MenothRank #118 · 18.4K reputationPosted Jan 17, 2016, 6:51 PM EST
Karthik ElumalaiRank #544 · 4.5K reputationPosted Jun 7, 2016, 2:27 AM EDT
Vasanth NatarajanRank #3,352 · 429 reputationPosted Jun 7, 2016, 4:24 AM EDT
Avikshith AradhyaRank #4,672 · 331 reputationPosted Jun 7, 2016, 4:31 AM EDT
Sonu ChaudharyRank #1,045 · 1.8K reputationPosted Jun 10, 2016, 8:33 AM EDT
Attachment imgAtt2 = new Attachment(Server.MapPath("~\\images\\twiter.gif"));
Attachment imgAtt2 = new Attachment(Server.MapPath("..\\images\\twiter.gif"));