none
Error sending mail using SmtpClient, MailMessage RRS feed

  • Question

  • I'm sending email using .net classes "SmtpClient, MailMessage". I don't know what's going wrong its keep giving the following error message.

     

    "User not local; please try a different path. The server response was: Bad Recipient"

     

    The SMTP server IP, port, username, password in NetworkCredentials are correct and same settings I configured in Outlook and its sending emails inside the domain recepients and to outside domain recepients.

     

    I used the same mail sending classes in the past and never had any problem. Even I sent mail using CDONTS and CDOSYS in ASP several times and never have any problem.

     

    The only difference this time is, I'm using Matrix mail server instead of MS virtual SMTP server but I don't think the problem can be with this because if using same settings and credentials I can send mail through Outlook even accessing SMTP from outside then why is it not sending from the same machine in my ASP.net application.

     

     

    Please guide me about this problem, I searched for this on several forums, so many other people face this problem but didn't find any solution.

     

    Thanks in advance.

     

    Regards,

    Adil

    Monday, May 19, 2008 1:43 PM

All replies

  • Clearly, you haven't been able to convince the mail server that you are entitled to send mail to users outside of the domain.  You'll need to look up the settings of the mail server to see what is required.  It could be as simple as EnableSsl = true or DefaultCredentials = true.
    Hans Passant.
    Sunday, June 1, 2008 2:35 PM
    Moderator