locked
Sending emails. SMTP Mail Server & Credentials RRS feed

  • Question

  • User-118566489 posted

    I am trying to send emails via my website. I am guessing that my credentials are my windows user ID and password that I used to access my Outlook email account, but I have no clue as to what to use for the MailServer.

    I am using Windows XP, which is supposed to have a built in Mail Server, but I don't know what it is called or how to find out what it is called.

    Can anyone tell me what it would be, or how to determine what it would be?

     

    Code is below.

     

        public static void SendMail(string ParmFrom, string ParmTo, string ParmSubject, string ParmBody) {
            PrvSmtpClient = new SmtpClient(MailServer);
            PrvSmtpClient.Credentials = new NetworkCredential(MailUsername, MailPassword);
            PrvMailMessage = new MailMessage(ParmFrom, ParmTo, ParmSubject, ParmBody);
            PrvSmtpClient.Send(PrvMailMessage);
        }
    
    
    
        public static string MailServer { get { return ConfigurationManager.AppSettings["MailServer"]; } }                                         // Mail server
        public static string MailUsername { get { return ConfigurationManager.AppSettings["MailUsername"]; } }                              // Email username
        public static string MailPassword { get { return ConfigurationManager.AppSettings["MailPassword"]; } }                               // Email password

     

    Wednesday, December 30, 2009 12:31 PM

Answers

  • User-110466603 posted

    If you website you are running is localhost any email server would be fine.  Do you need to use the one on your local machine?  If so, you will need to make sure your IIS on Windows XP has an SMTP Server installed.  See this link

    http://www.ehow.com/how_4489548_set-up-smtp-server-windows.html

    Otherwise, if it doesn't need to be that and you can use your internet service provider's SMTP (if they allow it) or your hosting providers SMTP server.  For example, if you are using outlook for an email account that is hosted with one of the service providers I mentioned above, those settings are already in your outlook and you can copy them from there.

    Also, is this an application on a company Intranet? If so, then you would need to know the mail server settings the company uses as well.

    Hope this gets you going in the right direction

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, December 30, 2009 2:33 PM

All replies

  • User-110466603 posted

    If you website you are running is localhost any email server would be fine.  Do you need to use the one on your local machine?  If so, you will need to make sure your IIS on Windows XP has an SMTP Server installed.  See this link

    http://www.ehow.com/how_4489548_set-up-smtp-server-windows.html

    Otherwise, if it doesn't need to be that and you can use your internet service provider's SMTP (if they allow it) or your hosting providers SMTP server.  For example, if you are using outlook for an email account that is hosted with one of the service providers I mentioned above, those settings are already in your outlook and you can copy them from there.

    Also, is this an application on a company Intranet? If so, then you would need to know the mail server settings the company uses as well.

    Hope this gets you going in the right direction

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, December 30, 2009 2:33 PM
  • User-118566489 posted

    I am using a company itranet, and have outlook. Where can I go in outlook to find out the name of the mail server?

     

    Wednesday, December 30, 2009 3:12 PM
  • User-118566489 posted

    Found it!!!!

     

    It is working!!!!!

     

    Thanks 

    Wednesday, December 30, 2009 3:18 PM