SMTP settings for sending mail OUTSIDE the domain

Discussion in 'Site Programming, Development and Design' started by Chancellor2000, Oct 28, 2014.

  1. I am using the following code which I modified from the knowledge base:
    Dim strFrom =postmaster account

    Dim MailMsg As New MailMessage(New MailAddress(strFrom.Trim()), New MailAddress(address))
    MailMsg.BodyEncoding = Encoding.Default
    MailMsg.Subject = thesubject
    MailMsg.Body = mailmessage

    MailMsg.IsBodyHtml = True
    'Smtpclient to send the mail message

    Dim SmtpMail As New SmtpClient
    Dim basicAuthenticationInfo As New System.Net.NetworkCredential("thepostmasteraccount", "thepassword")--obviously these are the correct account and password

    SmtpMail.Host = the correct smtp host
    SmtpMail.UseDefaultCredentials = False
    SmtpMail.Credentials = basicAuthenticationInfo


    However, I am getting an error when sending the email. The error is Mailbox unavailable: no such user here. I realize this is because I am sending OUTSIDE my domain. But how do I get this to send outside the domain?
  2. Elshadriel

    Elshadriel Winhost Staff

    That error message usually occurs when you don't provide the correct SMTP authentication credentials. Are you sure you are supplying the correct information? If you don't feel comfortable sharing the information on the forums, then open up a support ticket, and we'll review it for you.
    Last edited by a moderator: Oct 14, 2015
    Michael likes this.

Share This Page