locked
Can I send the email without defining credentials? RRS feed

  • Question

  • Hi,

    I am using SMTP to send the emails from my Window Service.

    Below is the code:

    smtp.UseDefaultCredentials = false;
    smtp.Credentials = new System.Net.NetworkCredential(UserName, PassWord);

    My query is: can I send the emails without defining the credentials?

    Thanks & regards,

    Afreen
    Thursday, September 3, 2009 5:37 AM

Answers

  • It depend on your SMTP Server. Some smtp server requires Credentials and some doesn't require credentials. So if your smtp server doesn't require credentials then you send without defining it
    Gaurav Khanna
    • Proposed as answer by Geert van Horrik Thursday, September 3, 2009 8:16 AM
    • Marked as answer by eryang Wednesday, September 9, 2009 3:10 AM
    Thursday, September 3, 2009 5:40 AM

All replies

  • It depend on your SMTP Server. Some smtp server requires Credentials and some doesn't require credentials. So if your smtp server doesn't require credentials then you send without defining it
    Gaurav Khanna
    • Proposed as answer by Geert van Horrik Thursday, September 3, 2009 8:16 AM
    • Marked as answer by eryang Wednesday, September 9, 2009 3:10 AM
    Thursday, September 3, 2009 5:40 AM
  •             
    • Proposed as answer by Geert van Horrik Thursday, September 3, 2009 8:16 AM
    • Edited by Ryal M. _ Sunday, February 28, 2010 3:44 AM
    Thursday, September 3, 2009 7:31 AM