locked
sending mail thru the local smtp server RRS feed

  • Question

  • User-125499312 posted

    what is the simplest way to send mail thru the local SMTP server and the simplest way to set up the SMTP server

    thx for ur help

    Thursday, March 26, 2020 8:32 PM

All replies

  • User-258456925 posted

    what do you mean by local smtp server? do you want to use your hosting server or gmail?

    Sunday, March 29, 2020 4:47 AM
  • User521825913 posted

    try this code..

    SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
    SmtpServer.Port = 587;
    SmtpServer.Credentials = new System.Net.NetworkCredential("username", "password");

    Fill source...Asp.Net Email

    Wednesday, April 1, 2020 5:51 AM
  • User-125499312 posted

    hi evan

    thanks for the reply

    i wold like to use the local smtp server and send with out username/password

    Wednesday, April 1, 2020 2:36 PM
  • User521825913 posted

    When you are using the local IIS SMTP service, set the DeliveryMethod to PickupDirectoryFromIis. For example:

      smtpClient.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;
    Thursday, April 2, 2020 4:32 AM