Click here to Skip to main content
15,893,622 members
Home / Discussions / C#
   

C#

 
QuestionCannot access a disposed object. Object name : System.Net.Mail.MailMessage Pin
Jassim Rahma12-Nov-14 20:35
Jassim Rahma12-Nov-14 20:35 
AnswerRe: Cannot access a disposed object. Object name : System.Net.Mail.MailMessage Pin
BillWoodruff12-Nov-14 21:04
professionalBillWoodruff12-Nov-14 21:04 
AnswerRe: Cannot access a disposed object. Object name : System.Net.Mail.MailMessage Pin
Bernhard Hiller12-Nov-14 21:10
Bernhard Hiller12-Nov-14 21:10 
I guess it is caused by the combination of
C#
client.SendAsync(message, userState);
message.Dispose();

Because of the async part, that function returns immediately, though the process of sending may not even have started. But now you call Dispose on the message object which is still to be sent / being sent.
I suggest to remove the message.Dispose line.
AnswerRe: Cannot access a disposed object. Object name : System.Net.Mail.MailMessage Pin
Marco Bertschi13-Nov-14 23:05
protectorMarco Bertschi13-Nov-14 23:05 
QuestionAsk Pin
kavnico12-Nov-14 16:50
kavnico12-Nov-14 16:50 
AnswerRe: Ask Pin
BillWoodruff12-Nov-14 20:30
professionalBillWoodruff12-Nov-14 20:30 
AnswerRe: Ask Pin
Richard MacCutchan12-Nov-14 21:22
mveRichard MacCutchan12-Nov-14 21:22 
GeneralRe: Ask Pin
ZurdoDev13-Nov-14 3:07
professionalZurdoDev13-Nov-14 3:07 
GeneralRe: Ask Pin
Richard MacCutchan13-Nov-14 3:10
mveRichard MacCutchan13-Nov-14 3:10 
GeneralRe: Ask Pin
ZurdoDev13-Nov-14 3:19
professionalZurdoDev13-Nov-14 3:19 
QuestionC# FormatCurrency(VB) to ToString Pin
Member 876492812-Nov-14 10:23
Member 876492812-Nov-14 10:23 
AnswerRe: C# FormatCurrency(VB) to ToString Pin
Eddy Vluggen12-Nov-14 10:47
professionalEddy Vluggen12-Nov-14 10:47 
AnswerRe: C# FormatCurrency(VB) to ToString Pin
Pete O'Hanlon12-Nov-14 10:58
mvePete O'Hanlon12-Nov-14 10:58 
GeneralRe: C# FormatCurrency(VB) to ToString Pin
Dominic Burford13-Nov-14 4:25
professionalDominic Burford13-Nov-14 4:25 
GeneralRe: C# FormatCurrency(VB) to ToString Pin
Pete O'Hanlon13-Nov-14 4:49
mvePete O'Hanlon13-Nov-14 4:49 
GeneralRe: C# FormatCurrency(VB) to ToString Pin
Dominic Burford13-Nov-14 5:34
professionalDominic Burford13-Nov-14 5:34 
AnswerRe: C# FormatCurrency(VB) to ToString PinPopular
Dave Kreskowiak12-Nov-14 11:13
mveDave Kreskowiak12-Nov-14 11:13 
GeneralRe: C# FormatCurrency(VB) to ToString Pin
Bernhard Hiller12-Nov-14 21:15
Bernhard Hiller12-Nov-14 21:15 
AnswerRe: C# FormatCurrency(VB) to ToString Pin
Dominic Burford13-Nov-14 5:34
professionalDominic Burford13-Nov-14 5:34 
QuestionStrange thing with AsemblyResolve event Pin
Marcos Bischoff12-Nov-14 4:28
Marcos Bischoff12-Nov-14 4:28 
AnswerRe: Strange thing with AsemblyResolve event Pin
Eddy Vluggen12-Nov-14 8:05
professionalEddy Vluggen12-Nov-14 8:05 
AnswerRe: Strange thing with AsemblyResolve event Pin
Freak3013-Nov-14 1:11
Freak3013-Nov-14 1:11 
QuestionQuick Loading of WPF application Pin
teek1312-Nov-14 2:42
teek1312-Nov-14 2:42 
AnswerRe: Quick Loading of WPF application Pin
SledgeHammer0112-Nov-14 5:04
SledgeHammer0112-Nov-14 5:04 
GeneralRe: Quick Loading of WPF application Pin
teek1312-Nov-14 8:32
teek1312-Nov-14 8:32 

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.