Click here to Skip to main content
15,885,890 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All

I have a program where the user can select the signature they want to use on the emails that gets created from my program. I display the paths of all the signatures on the current user computer in a listbox and they choose the one they want to use. All is working fine except the picture in the signature show a red cross. Here is the code I am using to generate the email and adding the chosen signature:

Here is the code that I use to get the selected signature, reading it and adding it in my signature:

C#
//Read and adding the selected signature
  string signature = lstSignatures.SelectedItem.ToString();

  StreamReader sigReader = new StreamReader(signature);

mailItem.HTMLBody = "<font face =\"Calibri\">Dear Sirs " + "<br>" + "<br>" +
                      "Attached, please find our Renewal Reminder for your kind attention." + "<br>" + "<br>" +
                      "Kind Regards </font>" + "<br>" + sigReader.ReadToEnd();



[edit]
As requested:
XML
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 12">
<meta name=Originator content="Microsoft Word 12">
<link rel=File-List href="Test123_files/filelist.xml">
<link rel=Edit-Time-Data href="Test123_files/editdata.mso">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<link rel=themeData href="Test123_files/themedata.thmx">
<link rel=colorSchemeMapping href="Test123_files/colorschememapping.xml">
<!--[if gte mso 9]><xml>
 <w:worddocument>
  <w:view>Normal</w:view>
  <w:zoom>0</w:zoom>
  <w:trackmoves>
  <w:trackformatting>
  <w:punctuationkerning>
  <w:validateagainstschemas>
  <w:saveifxmlinvalid>false</w:saveifxmlinvalid>
  <w:ignoremixedcontent>false</w:ignoremixedcontent>
  <w:alwaysshowplaceholdertext>false</w:alwaysshowplaceholdertext>
  <w:donotpromoteqf>
  <w:lidthemeother>EN-ZA</w:lidthemeother>
  <w:lidthemeasian>X-NONE</w:lidthemeasian>
  <w:lidthemecomplexscript>X-NONE</w:lidthemecomplexscript>
  <w:donotshadeformdata>
  <w:compatibility>
   <w:breakwrappedtables>
   <w:snaptogridincell>
   <w:wraptextwithpunct>
   <w:useasianbreakrules>
   <w:dontgrowautofit>
   <w:splitpgbreakandparamark>
   <w:dontvertaligncellwithsp>
   <w:dontbreakconstrainedforcedtables>
   <w:dontvertalignintxbx>
   <w:word11kerningpairs>
   <w:cachedcolbalance>
   <w:usefelayout>
  </w:usefelayout></w:cachedcolbalance></w:word11kerningpairs></w:dontvertalignintxbx></w:dontbreakconstrainedforcedtables></w:dontvertaligncellwithsp></w:splitpgbreakandparamark></w:dontgrowautofit></w:useasianbreakrules></w:wraptextwithpunct></w:snaptogridincell></w:breakwrappedtables></w:compatibility>
  <w:browserlevel>MicrosoftInternetExplorer4</w:browserlevel>
  <m:mathpr>
   <m:mathfont m:val="Cambria Math">
   <m:brkbin m:val="before">
   <m:brkbinsub m:val="--">
   <m:smallfrac m:val="off">
   <m:dispdef>
   <m:lmargin m:val="0">
   <m:rmargin m:val="0">
   <m:defjc m:val="centerGroup">
   <m:wrapindent m:val="1440">
   <m:intlim m:val="subSup">
   <m:narylim m:val="undOvr">
  </m:narylim></m:intlim></m:wrapindent></m:defjc></m:rmargin></m:lmargin></m:dispdef></m:smallfrac></m:brkbinsub></m:brkbin></m:mathfont></m:mathpr></w:donotshadeformdata></w:donotpromoteqf></w:validateagainstschemas></w:punctuationkerning></w:trackformatting></w:trackmoves></w:worddocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267">
  <w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal">
  <w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1">
  <w:lsdexception locked="false" priority="9" qformat="true" name="heading 2">
  <w:lsdexception locked="false" priority="9" qformat="true" name="heading 3">
  <w:lsdexception locked="false" priority="9" qformat="true" name="heading 4">
  <w:lsdexception locked="false" priority="9" qformat="true" name="heading 5">
  <w:lsdexception locked="false" priority="9" qformat="true" name="heading 6">
  <w:lsdexception locked="false" priority="9" qformat="true" name="heading 7">
  <w:lsdexception locked="false" priority="9" qformat="true" name="heading 8">
  <w:lsdexception locked="false" priority="9" qformat="true" name="heading 9">
  <w:lsdexception locked="false" priority="39" name="toc 1">
  <w:lsdexception locked="false" priority="39" name="toc 2">
  <w:lsdexception locked="false" priority="39" name="toc 3">
  <w:lsdexception locked="false" priority="39" name="toc 4">
  <w:lsdexception locked="false" priority="39" name="toc 5">
  <w:lsdexception locked="false" priority="39" name="toc 6">
  <w:lsdexception locked="false" priority="39" name="toc 7">
  <w:lsdexception locked="false" priority="39" name="toc 8">
  <w:lsdexception locked="false" priority="39" name="toc 9">
  <w:lsdexception locked="fals</div>	<div id=" editdialogplaceholder"=""></w:lsdexception></w:lsdexception></w:lsdexception></w:lsdexception></w:lsdexception></w:lsdexception></w:lsdexception></w:lsdexception></w:lsdexception></w:lsdexception></w:lsdexception></w:lsdexception></w:lsdexception></w:lsdexception></w:lsdexception></w:lsdexception></w:lsdexception></w:lsdexception></w:lsdexception></w:lsdexception></w:latentstyles>

[/edit]
Posted
Updated 9-Jun-14 23:22pm
v5
Comments
Richard MacCutchan 10-Jun-14 4:35am    
What is the actiual content of sigReader in this case?
Member 10459231 10-Jun-14 4:59am    
Moved content to original question.
Richard MacCutchan 10-Jun-14 5:22am    
That's some signature!
Member 10459231 10-Jun-14 6:01am    
I removed the text and only used the picture for a signature

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900