ASP .Net 1.1 Sending Emails - Configuration Question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • VladFromNYC
    New Member
    • Mar 2007
    • 9

    ASP .Net 1.1 Sending Emails - Configuration Question

    I got it working BUT......
    In my code I don't specify smtp server at all.
    So I don't know which server its using behind the scene.
    How can I find out and where this configuration is?
    Is this a CDO configuration?
    I could not find anything in the registry.
    The smtp server has been changed so i am tryin to figure out where I need to change it - nothing in my web.config and I don't even specify smtp server :-(
    Many thanks!
    using System.Web.Mail ;
    MailMessage msgMail = new MailMessage();
    msgMail.To = toperson;
    msgMail.From = fromperson;
    msgMail.Subject = emailsubject;
    msgMail.BodyFor mat = MailFormat.Html ;
    msgMail.Body = emailbody;
    SmtpMail.Send(m sgMail);
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    If you don't specify one, I think it tries to use an smtp server running on the local computer. Which either has no username/password, or would use the windows authentication

    Comment

    • VladFromNYC
      New Member
      • Mar 2007
      • 9

      #3
      Hi,
      Is there a way to determine what smtp is running locally?
      or a profile or something I can look or modify?
      Thanks!!

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        It will (almost always?) be the SMTP service which runs under the IIS service (inetinfo.exe). You can verify that it is enabled by running "services.m sc" and scrolling down to see "Simple Mail Transfer Protocol (SMTP)" and see if it is on.

        I don't know for sure, but I would imagine you can control it from the IIS control panel somehow (under "Administra tive Tools")

        Comment

        • VladFromNYC
          New Member
          • Mar 2007
          • 9

          #5
          but how to determine which SMTP it points to? I need to make a change and point to a different SMTP?

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            Ahh, well you can spcify that in your SMTPClient object.
            There is also a way to put it into your web.config I think, but I am unfamiliar with that

            Comment

            • VladFromNYC
              New Member
              • Mar 2007
              • 9

              #7
              No that's not what I meant.
              I don't specify SMTP in my .Net application. so lets leave it as is.
              I need to know how to edit/view SMTP settings on the machine where my app is running(not sure where to look - IIS or what).

              May be I got you confused. :-)
              Let's say you have a new machine - how to and where to look for smtp settings on this machine so when I install my .Net app I will know which smtp server it will be using to send emails out(and its not specified in my .Net app , remember?)
              Many Thanks!!!!

              Comment

              • joedeene
                Contributor
                • Jul 2008
                • 579

                #8
                If I understand you correctly, from your previous post, you want to configure your SMTP settings basically? Or get to the properties window.

                Well, In your Computer Management window, you should know how to navigate to the IIS Service. Once there, you should have a folder, (or a couple depends on what features of IIS you have installed), Right-click on the one that either says something about "SMTP Virtual Server" or it should have an envelope icon on the left of it. Then there is a "Properties " Item, click on that and it will open the properties window. Is that what you were looking for? If not, you've got me confused too :-P

                NOTE: This is on Windows XP.

                joedeene

                Comment

                • VladFromNYC
                  New Member
                  • Mar 2007
                  • 9

                  #9
                  joedeene,
                  the problem is that Virtual SMTP under IIS is not showing smtp host(at least in my case). I think it comes from somewhere else. I need to know where I can look it up and how to change it.
                  Many thanks!!!

                  Comment

                  • Plater
                    Recognized Expert Expert
                    • Apr 2007
                    • 7872

                    #10
                    I no longer have any idea what you are talking about.

                    A new windows machine, if IIS is turned on, would have the SMTP service as I dictated in one of my posts.
                    You said no, you wanted to change the settings in your program. So I told you that picking an smtp server and applying username/password was done in the SMTPClient object. You said no you want to edit the SMTP server on the machine.
                    Which has brought us RIGHT back to IIS. Now, IF, on the odd case, you use a third party SMTP solution, I would suggest you ask for help from them, as it's NOT a .NET question, and we really don't do support for third party applications.

                    Comment

                    • VladFromNYC
                      New Member
                      • Mar 2007
                      • 9

                      #11
                      Hi Plater,
                      Sorry I confused you...
                      I meant from IIS console-->
                      but how to determine which SMTP it points to? I need to make a change and point to a different SMTP?

                      I went under Virtual SMTP in IIS but couldn't find any references to actual SMTP mail servers. Under Rely tab its not specifying anything either.

                      But when I send an email from my .Net app it still sends to a specific smpt mail server - I want to know where it picks it setting since I don't specify it in my .Net app

                      Comment

                      • Plater
                        Recognized Expert Expert
                        • Apr 2007
                        • 7872

                        #12
                        IIS doesn't "point" to an smtp server. It *HAS* one.

                        If you want your application to use a different SMTP server, you need to supply the information to your SmtpClient object, or since you're using obsoleted classes, SMTPMail object.
                        Since you are using the obsoleted class, you are stuck without validating credentials I think. Since there is no mechanism for providing a username/password that I could see on MSDN.

                        If you have access to System.Net.Mail , I would switch over to it.

                        Comment

                        • VladFromNYC
                          New Member
                          • Mar 2007
                          • 9

                          #13
                          Originally posted by Plater
                          IIS doesn't "point" to an smtp server. It *HAS* one.

                          If you want your application to use a different SMTP server, you need to supply the information to your SmtpClient object, or since you're using obsoleted classes, SMTPMail object.
                          Since you are using the obsoleted class, you are stuck without validating credentials I think. Since there is no mechanism for providing a username/password that I could see on MSDN.

                          If you have access to System.Net.Mail , I would switch over to it.
                          OK. it has one but why the value of smtp is not showing up in Virtual SMTP (under IIS) tab. Is there is a command I can run from command prompt that will show me current SMTP host?
                          Many Thanks!!!!

                          Comment

                          • Plater
                            Recognized Expert Expert
                            • Apr 2007
                            • 7872

                            #14
                            Current SMTP is hot IS the virtual one under IIS. its localhost, 127.0.0.1
                            I don't know what you are asking here.
                            That service *IS* the smtp server/smtp host

                            Comment

                            • joedeene
                              Contributor
                              • Jul 2008
                              • 579

                              #15
                              I think he wants to know how to use his local SMTP's service by sending e-mails through C#. I don't know if I worded it right, or am on the right track, but I think he needs to know how he can use his SMTP service in his program.

                              joedeene

                              Comment

                              Working...