Click here to Skip to main content
15,902,112 members
Home / Discussions / C#
   

C#

 
AnswerRe: Model-View-Presenter Question Pin
Frygreen18-Aug-09 8:01
Frygreen18-Aug-09 8:01 
QuestionMDI parent MDI child issue Pin
gerrybrennan17-Aug-09 6:44
gerrybrennan17-Aug-09 6:44 
AnswerRe: MDI parent MDI child issue Pin
dan!sh 17-Aug-09 6:54
professional dan!sh 17-Aug-09 6:54 
GeneralRe: MDI parent MDI child issue Pin
gerrybrennan17-Aug-09 7:10
gerrybrennan17-Aug-09 7:10 
GeneralRe: MDI parent MDI child issue Pin
dan!sh 17-Aug-09 7:12
professional dan!sh 17-Aug-09 7:12 
GeneralRe: MDI parent MDI child issue Pin
gerrybrennan17-Aug-09 7:21
gerrybrennan17-Aug-09 7:21 
AnswerRe: MDI parent MDI child issue Pin
Henry Minute17-Aug-09 6:57
Henry Minute17-Aug-09 6:57 
GeneralRe: MDI parent MDI child issue Pin
gerrybrennan17-Aug-09 7:10
gerrybrennan17-Aug-09 7:10 
GeneralRe: MDI parent MDI child issue Pin
Henry Minute17-Aug-09 7:14
Henry Minute17-Aug-09 7:14 
GeneralRe: MDI parent MDI child issue Pin
gerrybrennan17-Aug-09 7:29
gerrybrennan17-Aug-09 7:29 
AnswerRe: MDI parent MDI child issue Pin
Dave Kreskowiak17-Aug-09 8:04
mveDave Kreskowiak17-Aug-09 8:04 
GeneralRe: MDI parent MDI child issue Pin
gerrybrennan17-Aug-09 20:28
gerrybrennan17-Aug-09 20:28 
QuestionConsole app minimize to system tray? Pin
devvvy17-Aug-09 6:15
devvvy17-Aug-09 6:15 
AnswerRe: Console app minimize to system tray? Pin
Rajesh R Subramanian17-Aug-09 6:44
professionalRajesh R Subramanian17-Aug-09 6:44 
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 

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.