A Simple question about sending emails

Discussion in 'ASP.NET / ASP.NET Core' started by balexandre, Dec 2, 2010.

  1. Hi,

    I still didn't figure it out how to send emails from my website that is hosted in IIS7.

    I'm an experienced .NET developer, so, I'll cut to the chase


    If I use:

    smtp.Host = "64.79.170.132";
    smtp.Port = 25;
    smtp.EnableSsl = false;

    it seams that I can only send emails to any username that exists in my mailbox as I get an error saying that the email I'm trying to send, does not exist in this server (this as the SMTP server)

    If I use:

    smtp.Host = "64.79.170.132";
    smtp.Port = 25;
    smtp.EnableSsl = false;
    smtp.Credentials = new NetworkCredential("[email protected]", "mypassword");

    being "[email protected]" a user created in the http://64.79.170.132


    or smtp port number 587, I do not get any exception, but the email never reaches the destination.

    What can I do to debug/find out how can I send emails from my application to persons?

    I am sending emails acting on Spam rules, so, no worries there.
     
  2. dmitri

    dmitri DiscountASP.NET Staff

    When you are sending messages through a web application, please specify "localhost" as the SMTP server with user name and password left blank to send messages through the local mail relay. If you prefer to use IP address instead of localhost, then please use 127.0.0.1
     

Share This Page