Click here to Skip to main content
13,905,482 members
   

C#

 
AnswerRe: Find Subnet Mask Pin
Luc Pattyn12-Jan-19 16:35
professionalLuc Pattyn12-Jan-19 16:35 
GeneralRe: Find Subnet Mask Pin
Richard Andrew x6413-Jan-19 4:22
professionalRichard Andrew x6413-Jan-19 4:22 
Questionimport data Pin
Member 1358870012-Jan-19 3:15
memberMember 1358870012-Jan-19 3:15 
AnswerRe: import data Pin
Richard MacCutchan12-Jan-19 3:37
protectorRichard MacCutchan12-Jan-19 3:37 
AnswerRe: import data Pin
Victor Nijegorodov12-Jan-19 5:01
memberVictor Nijegorodov12-Jan-19 5:01 
AnswerRe: import data Pin
OriginalGriff12-Jan-19 5:30
protectorOriginalGriff12-Jan-19 5:30 
AnswerRe: import data Pin
mtoha13-Jan-19 17:44
professionalmtoha13-Jan-19 17:44 
QuestionSmtpclient "One of the streams has already been used and can't be reset to the origin." Pin
jkirkerx10-Jan-19 11:49
professionaljkirkerx10-Jan-19 11:49 
In my Winform App, I'm sending an email with an attachment and I get the above error. Kind of stumped on this and I know it' attachment related.
So I get this on the first run after starting the program.
I generate a PDF, write it to AppData folder, then program the Smtp Client, run the code below.

I tried ..
Comment out the attachment and it works fine.
Tried not using "using"
Tried fileStream.Position = 0
Tried fileStream.FlushAsync = 0
Searched for a quick fix but never really found anything.

I'm using CeTe Dynamic PDF to generate the PDF with Document.Draw
// Add any attachments from the product web page
if (message.FilePath != null )
{
    using (var fileStream = File.OpenRead(message.FilePath))
    {
        var attach = new Attachment(fileStream, message.FilePath);
        mailMessage.Attachments.Add(attach);
        await fileStream.FlushAsync();
    }
}

// Load the SMTP Credentials                
using (var smtpClient = SendEngineAsync.Create_SMTPClient(smtpC))
{
    // Fire the send engine async
    var result = await SendEngineAsync.SendEmailAsync(smtpClient, mailMessage, 5);
    SendEngineAsync.ProcessSendResult(resend, result);
}
If it ain't broke don't fix it
Discover my world at jkirkerx.com

AnswerRe: Smtpclient "One of the streams has already been used and can't be reset to the origin." Pin
jkirkerx10-Jan-19 11:57
professionaljkirkerx10-Jan-19 11:57 
SuggestionRe: Smtpclient "One of the streams has already been used and can't be reset to the origin." Pin
Richard Deeming11-Jan-19 1:50
mveRichard Deeming11-Jan-19 1:50 
GeneralRe: Smtpclient "One of the streams has already been used and can't be reset to the origin." Pin
jkirkerx13-Jan-19 9:30
professionaljkirkerx13-Jan-19 9:30 
QuestionC# Winforms, Pass a button click to a user control on the form. Pin
jkirkerx7-Jan-19 12:54
professionaljkirkerx7-Jan-19 12:54 
AnswerRe: C# Winforms, Pass a button click to a user control on the form. Pin
Dave Kreskowiak7-Jan-19 16:43
mveDave Kreskowiak7-Jan-19 16:43 
GeneralRe: C# Winforms, Pass a button click to a user control on the form. Pin
jkirkerx8-Jan-19 6:29
professionaljkirkerx8-Jan-19 6:29 
AnswerRe: C# Winforms, Pass a button click to a user control on the form. Pin
OriginalGriff7-Jan-19 20:24
protectorOriginalGriff7-Jan-19 20:24 
GeneralRe: C# Winforms, Pass a button click to a user control on the form. Pin
jkirkerx8-Jan-19 6:33
professionaljkirkerx8-Jan-19 6:33 
GeneralRe: C# Winforms, Pass a button click to a user control on the form. Pin
OriginalGriff8-Jan-19 6:47
protectorOriginalGriff8-Jan-19 6:47 
GeneralRe: C# Winforms, Pass a button click to a user control on the form. Pin
jkirkerx8-Jan-19 7:21
professionaljkirkerx8-Jan-19 7:21 
QuestionMEF Question Pin
Kevin Marois7-Jan-19 11:48
professionalKevin Marois7-Jan-19 11:48 
AnswerRe: MEF Question Pin
Mycroft Holmes7-Jan-19 14:32
memberMycroft Holmes7-Jan-19 14:32 
AnswerRe: MEF Question Pin
Dave Kreskowiak7-Jan-19 16:40
mveDave Kreskowiak7-Jan-19 16:40 
AnswerRe: MEF Question Pin
Pete O'Hanlon7-Jan-19 19:38
protectorPete O'Hanlon7-Jan-19 19:38 
QuestionFailure to recognize Toolbox controls inside the encoding environment in visual 2010 Pin
Member 141105447-Jan-19 4:15
memberMember 141105447-Jan-19 4:15 
AnswerRe: Failure to recognize Toolbox controls inside the encoding environment in visual 2010 Pin
BillWoodruff7-Jan-19 4:32
mveBillWoodruff7-Jan-19 4:32 
AnswerRe: Failure to recognize Toolbox controls inside the encoding environment in visual 2010 Pin
OriginalGriff7-Jan-19 4:46
protectorOriginalGriff7-Jan-19 4:46 

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.


Advertise | Privacy | Cookies | Terms of Service
Web02 | 2.8.190306.1 | Last Updated 26 Mar 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid