This project is read-only.

SMTP rs.State Rcpt outside domain

Jun 14, 2013 at 8:23 AM
Edited Jun 14, 2013 at 8:24 AM
Hello!

I'm using below stated smtp server code to send email but problem is that when I'm trying to send outside my domain it just fails rs.SendSuccessful = false and State is Rcpt. Could you please help me with that?
When I'm using same domain it's working fine...
using (SmtpClient cl = new SmtpClient())
                {
                    cl.ServerName = server;
                    cl.Port = port;
                    cl.Ssl = ssl;
                    SmtpMessage mg = new SmtpMessage();
                    mg.Subject = title;
                    mg.BodyText = bodytext;
                    //Send by HTML format
                    mg.IsHtml = html;
                    mg.From = new MailAddress(from, fromDisplay);
                    foreach (string emailTo in to)
                    {
                        mg.To.Add(new MailAddress(emailTo));
                    }
                    cl.UserName = user;
                    cl.Password = pass;
                    if (authtype.Length > 0)
                    {
                        cl.AuthenticateMode = (SmtpAuthenticateMode)Enum.Parse(typeof(SmtpAuthenticateMode), authtype);
                    }
                    else
                        cl.AuthenticateMode = SmtpAuthenticateMode.None;
                    //cl.Open();
                    if (cl.Authenticate())
                    {
                        var rs = cl.SendMail(mg);
                        //Check mail was sent or not
                        if (rs.SendSuccessful == false)
                        {
                            //You can get information about send mail is success or error reason
                            var resultState = rs.State;
                        }
                    }
                }
Jun 14, 2013 at 8:30 AM
solved it! I've configured None login and it's obvious that you need to authenticate against server...