Syntax error, command unrecognized. The server response was: 'HELO W01': command not

Discussion in 'General troubleshooting' started by bahaa1985, Dec 4, 2009.

  1. I used this code:

    //create the mail message
    MailMessage mail = new MailMessage();

    //set the addresses
    mail.From = new MailAddress("");

    //set the content
    mail.Subject = "This is an email";
    mail.Body = "this is a sample body with html in it. <b>test e-mail </b>";
    mail.IsBodyHtml = true;

    //send the message
    SmtpClient smtp = new SmtpClient("", 21);
    NetworkCredential Credentials = new NetworkCredential("", "password","");
    smtp.Credentials = Credentials;

    and I insert these tags within web.config file:

    <smtp deliveryMethod="Network">
    <network host ="" port ="21" defaultCredentials="true"/>

    but I get this error:

    Syntax error, command unrecognized. The server response was: 'HELO W01': command not understood.
  2. Ray


    Change these lines on your code...

    SmtpClient smtp = new SmtpClient("", 21);
    SmtpClient smtp = new SmtpClient("");


    <network host ="" port ="21" defaultCredentials="true"/>
    <network host ="" port ="25" defaultCredentials="true"/>

    Port 21 is a FTP port it is not a SMTP port.
  3. I did as you said, but i get this error:

    No connection could be made because the target machine actively refused it
  4. Ray


    Sorry I just realized the IP address you are using is the web servers IP address. The email server will have a different IP address. Try using this as the smtp server ''. This will point you to our email server.
  5. I got a new error:

    Mailbox unavailable. The server response was: <> No such user here

    [SmtpFailedRecipientException: Mailbox unavailable. The server response was: <postmaster@fishabaka.comm> No such user here]
    System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception) +1078355
    System.Net.Mail.SmtpClient.Send(MailMessage message) +1480
    _Default.Button1_Click(Object sender, EventArgs e) in e:\web\fishabak\Default.aspx.cs:34
    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

    should I change any settings of my e-mail from control panel?
  6. Ray


    Mailbox unavailable. The server response was: <my-emailr@live.comm> No such user here

    This error means that the email address my-emailr@live.comm does not exist. I tried to ping 'live.comm' and the ping test failed so it proves that 'live.comm' doesn't exist. I'm not sure if it is '' or something else but the error is pretty straight forward. This email 'my-emailr@live.comm' does not exist. Type in another email address and make sure it is a valide and active email address.
  7. FredC

    FredC Winhost Staff

    dude.. you are trying to send to live.comm with an extra m.
  8. it's just typing error while typing the replying .....

    but the syntax is well at my code ......
  9. Ray


    Was this error type wrong also?

    --SmtpFailedRecipientException: Mailbox unavailable. The server response was: <postmaster@fishabaka.comm> No such user here--

    Regardless, the email address you are typing on the code is wrong or the email address does not exist. I suggest double checking them.
  10. O.K ... I can now send e-mail to

    but I can't to external e-mails

    I always get this error:

    Mailbox unavailable. The server response was: <> No such user here
  11. Ray


    Are you sure that this email address is active ''?

    If the email address are active, then the most likely cause is that you are not passing the SMTP authentication correctly. Remember, our SMTP server requires that you log in first before it will send out the email.
  12. hi Ray .....

    What do you mean by SMTP authentication? if you mean username & password ,both of them are right.

    should I make any configuration of my mail server???
  13. Ray


    SMTP authentication is just another phrase which means you need to pass a login and password to the email server before the email server will send out the email. The login and password for the smtp server will not be the account or site ID login, but the full email address that exist in our smtp server. Typically you should have a postmaster account that will have an email address similar to this 'postmaster@[somethingdomain].com'. I will not know the password that is something you will need to find out for yourself.
    Some programmers choose to declare these values and pass it off as variables. I suggest that you do not declare them but hard code them in.
    How do you know if your email account is working?
    The best way to know is to setup an email client such as Outlook to connect to the POP3 and SMTP server and set it up for SMTP authentication. If you email client can send it out then the SMTP server is working and it should work for your web site. But if it is not working for your website then you'll know its because of some programming mistake somewhere in the coding.
  14. I did it !!!!!!!!

    I just removed the parameter of string domain ( .. and I can now send e-mails to any e-mail !!!

    Than kyou very much Ray
  15. Ray


    I believe you are speaking of this line..

    NetworkCredential Credentials = new NetworkCredential("", "password","");

    Sorry I should have caught that.

Share This Page