Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 227405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:35:44+00:00 2026-05-11T19:35:44+00:00

The following code nets me out error after error. MailMessage Enveloppe = new MailMessage();

  • 0

The following code nets me out error after error.

        MailMessage Enveloppe = new MailMessage();

        //emails is an array of strings
        foreach ( string email in emails )
            Enveloppe.To.Add(email);

        //Setup message parameters
        Enveloppe.Subject = "Documentation";
        Enveloppe.Body = "Infinitelycoolbodyhere"
        Enveloppe.From = new MailAddress("mrzombie@stuff", "Myname");

        //files is an array of strings
        foreach ( string filename in files ) { 
            //Add attachments
            Enveloppe.Attachments.Add(new Attachment(new System.Net.WebClient().OpenRead(filename),filename.Substring(filename.LastIndexOf('/'))));
        }

        //Create the smtp client, and let it do its job
        SmtpClient Mailman = new SmtpClient("mysmtphost");
        Mailman.EnableSsl = true;
        Mailman.Port = 465;
        Mailman.DeliveryMethod = SmtpDeliveryMethod.Network;
        Mailman.Credentials = new System.Net.NetworkCredential("usernamehere", "passwordhere");
        Mailman.Send(Enveloppe);

It so happens that it either tells me that my operation timed out, or that “A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond”.

I’m stumped, I don’t see which part of it I am doing wrong

Update: I can’t seem to connect to the server from Telnet, at best I connect with my laptop (under ubuntu), but I never get the “200” response. Under the windows workstation, I get a perpetual blank telnet window.

I can send/receive e-mail at the specified server with Thunderbird without any problem whatsoever.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T19:35:45+00:00Added an answer on May 11, 2026 at 7:35 pm

    Finally found the culprit – somehow the connection was left hanging between the “supposedly correct” smtp server the hosting company was giving me, and the actual smtp server. I just changed the address of mail.domain.com to smtp.hostingdomain.com and it fixed everything.

    This is just one of those “what the hell” moments that I hate. Because of it, I had to drop the feature of application-based mail-sending, but in the end my boss and I decided that we’d instead host the files somewhere and include the links in the e-mail instead of appending attached files to the mail.

    So, yeah, that doesn’t really answer the question, but to those who consider the solution, but you might want to put the files you want to send on a place accessible from the outside and include linkage instead. There.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 105k
  • Answers 105k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can simply add a ListItem inside the DropDownList Markup.… May 11, 2026 at 8:41 pm
  • Editorial Team
    Editorial Team added an answer You haven't used the override modifier on p.GetHashCode (unlike p.Equals).… May 11, 2026 at 8:41 pm
  • Editorial Team
    Editorial Team added an answer If you don't want if to beep, you'll either have… May 11, 2026 at 8:41 pm

Related Questions

I just saw this question: Understanding .NET’s SecurityAction parameter for permissions And I have
I have a problem with the .NET's Uri implementation. It seems that if the
How exactly does NSInvocation work? Is there a good introduction? I’m specifically having issues
The following code works great in IE, but not in FF or Safari. I
The following code doesn't compile with gcc, but does with Visual Studio: template <typename

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.