我需要从附加的图像中在 mailItem 的主体上显示图像。但它一直显示文件名(img.jpg)。我尝试添加 html 标签,但它也显示了文件名。
如何让它显示图像而不是文件名?
这是我得到的:
byte[] imageData = null;
if (inspectorForm.txtEventPictureURL.Text != "")
{
//string imagepath = "http://---/Pictures/"+ inspectorForm.txtEventPictureURL.Text;
//string imagepath = "C:\Users\---\img.jpg";
string imagepath = inspectorForm.txtEventPictureURL.Text;
//convert image url into byte
//code here
mailItem.Body = Environment.NewLine + "Event Title : " + inspectorForm.txtTitle.Text + Environment.NewLine + "Event Description : " + inspectorForm.txtDescription.Text + Environment.NewLine + "Event Start Date From :" + inspectorForm.dtpStartDate.Text + " To " + inspectorForm.dtpEndDate.Text + Environment.NewLine + "Time From : " + inspectorForm.cbStartHours.Text + " : " + inspectorForm.cbStartMins.Text + " To " + inspectorForm.cbEndHours.Text + " : " + inspectorForm.cbEndMins.Text + Environment.NewLine
+ "Image Url : " + Directory.GetDirectories(imagepath) ;
}