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.
Sonu ChaudharyPosted Jun 10, 2016, 12:33 PM
Attachment imgAtt2 = new Attachment(Server.MapPath("~\\images\\twiter.gif"));
Attachment imgAtt2 = new Attachment(Server.MapPath("..\\images\\twiter.gif"));
Avikshith AradhyaPosted Jun 7, 2016, 8:31 AM
Vasanth NatarajanPosted Jun 7, 2016, 8:24 AM
Karthik ElumalaiPosted Jun 7, 2016, 6:27 AM
Rajeesh MenothPosted Jan 17, 2016, 11:51 PM
Malvik BhavsarPosted Jan 17, 2016, 11:15 PM
Attachment imgAtt2 = new Attachment(Server.MapPath("~\images\twiter.gif"));