Sending emails out from ASP.NET

Discussion in 'Development' started by Arash, Nov 1, 2016.

Thread Status:
This thread is more than 60 days old.
  1. Arash

    Arash New Member


    Has anyone managed to get sending of emails out from your website on Interserver working with ASP.NET?

    I've tried System.Net.Mail.MailMessage and System.Web.Mail.MailMessage and neither work.
    I'm a .NET developer so I know my way round this topic and I have managed to get this to work on other hosters.

    Interserver's solution is the obsolete and outdated CDO.Message!!

    I'm pretty sure it's there internal SMTP configuration which is the issue but I wanted to check to see if anyone else has managed to get this to work.

    This is the code - more or less:

    SmtpClient smtpClient = new SmtpClient("", 25);
    MailMessage mail = new MailMessage();
    //Setting From , To and CC
    mail.From = new MailAddress("");
    mail.To.Add(new MailAddress(""));
    mail.Body ="test";
    mail.Subject ="test";

    smtpClient.Credentials = new System.Net.NetworkCredential("", "PASSWORD");
    smtpClient.UseDefaultCredentials = false;
    smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
    smtpClient.EnableSsl = false;


    The support team have give me THREE different SMTP IPs that "SHOULD" work.


  2. Quags

    Quags Administrator Staff Member

    Check the mx record for your domain name. It may be or

    use this ip and not the server ip your site points to

    You can use port 25, 587 or 465 (ssl only on 465)
  3. Arash

    Arash New Member

    The mx record is which resolves to
    I've already tried this and on port 587 or 465, the process timeouts trying to connect to the smtp server.

    On port 25 it comes back with:
    "The remote certificate is invalid according to the validation procedure."

    With I get this:
    "Transaction failed. The server response was: 5.7.1 : Relay access denied"

    With Operation times out connecting to the smtp server

    The thing is, the same settings with works if I try the code from my home PC which makes me think that my website just cannot connect to the smtp server!!

    It all points to a misconfiguration on Interserver side of things!
  4. Arash

    Arash New Member

    If I use as smtp server, I get NO errors and everything seems to work but the email is not actually sent or received !
Thread Status:
This thread is more than 60 days old.

Share This Page