Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. GMail SMTP Outgoing Problem

GMail SMTP Outgoing Problem

Scheduled Pinned Locked Moved Web Development
csharpcomsysadminhelp
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DarkSorrow38
    wrote on last edited by
    #1

    In the following code snippet if I change the port number from 587 to any other (even to 465 as mentioned over the net) the mail sending attempts fail.

            string from1 = "from\_e-mail";
            string to1   = "to\_e-mail";
            string subject = "Test";
            const string password = "xxxxxxxx";
            string body = "Hello World";
            smtp.Host = "smtp.gmail.com";
            smtp.Port = 587;
            smtp.EnableSsl = true;
            smtp.UseDefaultCredentials = false;
            smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
            smtp.Credentials = new NetworkCredential(from1, password);
            smtp.Timeout = 20000000;
            smtp.Send(from1, to1, subject, body);
    

    Any Suggestion

    B L 2 Replies Last reply
    0
    • D DarkSorrow38

      In the following code snippet if I change the port number from 587 to any other (even to 465 as mentioned over the net) the mail sending attempts fail.

              string from1 = "from\_e-mail";
              string to1   = "to\_e-mail";
              string subject = "Test";
              const string password = "xxxxxxxx";
              string body = "Hello World";
              smtp.Host = "smtp.gmail.com";
              smtp.Port = 587;
              smtp.EnableSsl = true;
              smtp.UseDefaultCredentials = false;
              smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
              smtp.Credentials = new NetworkCredential(from1, password);
              smtp.Timeout = 20000000;
              smtp.Send(from1, to1, subject, body);
      

      Any Suggestion

      B Offline
      B Offline
      Bernhard Hiller
      wrote on last edited by
      #2

      The most important suggestion: Tell us the error message!

      D 1 Reply Last reply
      0
      • B Bernhard Hiller

        The most important suggestion: Tell us the error message!

        D Offline
        D Offline
        DarkSorrow38
        wrote on last edited by
        #3

        The problem is that noting happens. I believe connection is not getting established.

        1 Reply Last reply
        0
        • D DarkSorrow38

          In the following code snippet if I change the port number from 587 to any other (even to 465 as mentioned over the net) the mail sending attempts fail.

                  string from1 = "from\_e-mail";
                  string to1   = "to\_e-mail";
                  string subject = "Test";
                  const string password = "xxxxxxxx";
                  string body = "Hello World";
                  smtp.Host = "smtp.gmail.com";
                  smtp.Port = 587;
                  smtp.EnableSsl = true;
                  smtp.UseDefaultCredentials = false;
                  smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
                  smtp.Credentials = new NetworkCredential(from1, password);
                  smtp.Timeout = 20000000;
                  smtp.Send(from1, to1, subject, body);
          

          Any Suggestion

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Read the gmail help[^], where all is made clear.

          Use the best guess

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups