Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have got this this during mail send:

Bad sequence of commands. The server response was: This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server.


C#
SmtpClient sC = new SmtpClient("domain.com");
                sC.Host = ConfigurationManager.AppSettings["servername"];
                sC.Port = 25;
                sC.Credentials = new System.Net.NetworkCredential("username","password");
//smtp.EnableSsl = true;

                sC.Send(mM);
Posted

1 solution

"domain.com" which provided in the constructor will be replaced by the Host property you specify from the app settings, use one of those properties and give smtp host name correcty, for example is it is gmail smtp smtp.gmail.com
 
Share this answer
 
Comments
ManojanbU 19-Aug-15 3:46am    
Thanks for your reply. If i have use the rediffpro domain so i define smtp client like as "smtp.rediffmailpro.com" instead of "domain.com" for outdoing mail. But I got the same error.
DamithSL 19-Aug-15 3:56am    
where you host this this web site?
ManojanbU 19-Aug-15 5:11am    
Smtp client smtp.rediffmailpro.com.
ManojanbU 22-Aug-15 8:37am    
my company host.How Could Resolve

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900