Note that there are some explanatory texts on larger screens.

plurals
  1. POhtml tag not showing image when passing value at runtime using c#
    primarykey
    data
    text
    <p>i am using html page to send a mail, in which i am parsing the tags to give their value at run time.. but my problem is i have two img src tags. i am giving them value at run time, but as the mail is recieved it is showing only one image not both.. i don't know what might be the problem is. i am using the below code:</p> <pre><code> XmlDocument xmlDoc = new XmlDocument(); XmlNode node = null; xmlDoc.Load(theme); XmlNodeList list = xmlDoc.SelectNodes("html/body/form/div/img"); MailMessage mail = new MailMessage(); string from = ConfigurationManager.AppSettings["from"]; string password = ConfigurationManager.AppSettings["password"]; string smtp_port = ConfigurationManager.AppSettings["smtp_port"]; if(foot_image!= "") { Attachment imgAtt = new Attachment(foot_image); imgAtt.ContentId = footimage; imgAtt.ContentDisposition.Inline = true; list.Item(1).Attributes[0].Value = "cid:" + imgAtt.ContentId + ""; mail.Attachments.Add(imgAtt); } if(file != "") { Attachment ingatt1 = new Attachment(file); ingatt1.ContentId = headimage; ingatt1.ContentDisposition.Inline = true; list.Item(0).Attributes[0].Value = "cid:" + ingatt1.ContentId + ""; // node = xmlDoc.SelectSingleNode("html/body/form/div/img"); // node.Attributes[0].Value = "cid:" + ingatt1.ContentId + ""; mail.Attachments.Add(ingatt1); } xmlDoc.Save(theme); StreamReader sr = new StreamReader(theme); string theme_text = sr.ReadToEnd(); mail.To.Add(to); mail.From = new MailAddress(from); mail.Subject = "In line image test"; mail.Body = theme_text; mail.IsBodyHtml = true; </code></pre> <p>please sort out my problem..</p> <p>my html page is:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Untitled Page&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form&gt; &lt;div style="margin-left:50px; padding-top:10px"&gt; &lt;img src="" style="width:480px; height:150px;" /&gt; &lt;/div&gt; &lt;div style="margin-left:50px; padding-top:20px;"&gt; &lt;h1&gt; &lt;/h1&gt; &lt;/div&gt; &lt;div style="margin-left:50px; margin-top:200px;"&gt; &lt;img src='' style="width:480px; height:150px;" /&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload