Click here to Skip to main content
15,888,816 members
Home / Discussions / C#
   

C#

 
AnswerRe: Console app minimize to system tray? Pin
dan!sh 17-Aug-09 6:45
professional dan!sh 17-Aug-09 6:45 
GeneralRe: Console app minimize to system tray? Pin
Rajesh R Subramanian17-Aug-09 6:49
professionalRajesh R Subramanian17-Aug-09 6:49 
QuestionRequesting for help in coding Pin
sshakeerbaig17-Aug-09 6:01
sshakeerbaig17-Aug-09 6:01 
AnswerRe: Requesting for help in coding Pin
Luc Pattyn17-Aug-09 6:06
sitebuilderLuc Pattyn17-Aug-09 6:06 
AnswerRe: Requesting for help in coding Pin
Rajesh R Subramanian17-Aug-09 6:44
professionalRajesh R Subramanian17-Aug-09 6:44 
JokeRe: Requesting for help in coding Pin
PIEBALDconsult17-Aug-09 7:01
mvePIEBALDconsult17-Aug-09 7:01 
AnswerRe: Requesting for help in coding Pin
dan!sh 17-Aug-09 7:15
professional dan!sh 17-Aug-09 7:15 
QuestionProblems with embedding images in system.net.mail.mailmessage Pin
livez17-Aug-09 4:19
livez17-Aug-09 4:19 
Hello!

Some of the images I try to embedd do not show up in my email, but are instead sent as attachments. I can´t figure out why some are working and some arent. This is how I embedd images:

MailMessage mail = new MailMessage();<br />
<br />
string imagePath = System.Windows.Forms.Application.StartupPath + "\\pathToImages";<br />
<br />
LinkedResource resource1 = new LinkedResource(imagePath + "\\head21.jpg", <br />
                System.Net.Mime.MediaTypeNames.Image.Jpeg);<br />
resource1.ContentId = "head21.jpg";<br />
<br />
LinkedResource resource2 = new LinkedResource(imagePath + "\\border.jpg", <br />
                System.Net.Mime.MediaTypeNames.Image.Jpeg);<br />
resource2.ContentId = "border.jpg";<br />
<br />
StringBuilder content = new StringBuilder();<br />
<br />
....<br />
<br />
content.Append(string.Format("<td width=600 align=left><img border=0 align=center src=\"cid:head21.jpg\" width=600 height=57></td></tr></tbody></table></td></tr></tbody></table>"));<br />
<br />
..<br />
<br />
content.Append(string.Format("<td><img alt=\"\" src=\"cid:border.jpg\" width=560 height=21></td></tr></tbody></table></td>"));<br />
<br />
..<br />
<br />
string body = Mail.CreateHtmlFromTemplate(content.ToString(), string.Empty, null);<br />
<br />
AlternateView htmlView = AlternateView.CreateAlternateViewFromString(body, null, MediaTypeNames.Text.Html);<br />
<br />
htmlView.LinkedResources.Add(resource1);<br />
htmlView.LinkedResources.Add(resource2);


Here resource1 works fine, and shows up in body of email. Resource2 is instead sent as attachment and does not show up in the email. Does anyone have any idea why this is?
AnswerRe: Problems with embedding images in system.net.mail.mailmessage Pin
mustang8617-Aug-09 6:36
mustang8617-Aug-09 6:36 
GeneralRe: Problems with embedding images in system.net.mail.mailmessage [modified] Pin
livez17-Aug-09 21:58
livez17-Aug-09 21:58 
GeneralRe: Problems with embedding images in system.net.mail.mailmessage Pin
mustang8618-Aug-09 5:37
mustang8618-Aug-09 5:37 
QuestionRemove a Row of Data From Table of Database Pin
whenisyesterday17-Aug-09 3:39
whenisyesterday17-Aug-09 3:39 
AnswerRe: Remove a Row of Data From Table of Database Pin
Keith Barrow17-Aug-09 4:04
professionalKeith Barrow17-Aug-09 4:04 
AnswerRe: Remove a Row of Data From Table of Database Pin
whenisyesterday17-Aug-09 4:17
whenisyesterday17-Aug-09 4:17 
GeneralRe: Remove a Row of Data From Table of Database Pin
Keith Barrow17-Aug-09 5:09
professionalKeith Barrow17-Aug-09 5:09 
AnswerRe: Remove a Row of Data From Table of Database Pin
Hristo-Bojilov17-Aug-09 5:25
Hristo-Bojilov17-Aug-09 5:25 
GeneralRe: Remove a Row of Data From Table of Database Pin
whenisyesterday17-Aug-09 5:41
whenisyesterday17-Aug-09 5:41 
GeneralRe: Remove a Row of Data From Table of Database Pin
Hristo-Bojilov17-Aug-09 5:44
Hristo-Bojilov17-Aug-09 5:44 
GeneralRe: Remove a Row of Data From Table of Database Pin
whenisyesterday17-Aug-09 5:47
whenisyesterday17-Aug-09 5:47 
GeneralRe: Remove a Row of Data From Table of Database Pin
Hristo-Bojilov17-Aug-09 5:49
Hristo-Bojilov17-Aug-09 5:49 
GeneralRe: Remove a Row of Data From Table of Database Pin
whenisyesterday17-Aug-09 5:58
whenisyesterday17-Aug-09 5:58 
GeneralRe: Remove a Row of Data From Table of Database Pin
Keith Barrow17-Aug-09 6:11
professionalKeith Barrow17-Aug-09 6:11 
GeneralRe: Remove a Row of Data From Table of Database Pin
Hristo-Bojilov17-Aug-09 6:15
Hristo-Bojilov17-Aug-09 6:15 
GeneralRe: Remove a Row of Data From Table of Database Pin
Keith Barrow17-Aug-09 6:16
professionalKeith Barrow17-Aug-09 6:16 
GeneralRe: Remove a Row of Data From Table of Database Pin
whenisyesterday17-Aug-09 6:52
whenisyesterday17-Aug-09 6:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.