SMTP cannot send email

Feb 25, 2013 at 7:50 AM
Edited Feb 26, 2013 at 1:02 AM
Hi

I am using HigLabo3.5, VC# 2008
SendMail always return false with status: HigLabo.Net.Smtp.SendMailResultState.Helo
Authenticate() is successful. Could you help? Thanks
                        HigLabo.Net.Smtp.SmtpMessage mm = new HigLabo.Net.Smtp.SmtpMessage();

                        HigLabo.Net.Smtp.SmtpClient smtpcl = new HigLabo.Net.Smtp.SmtpClient(l_smtp,25,l_sender,l_sender_pwd);
                        smtpcl.AuthenticateMode = SmtpAuthenticateMode.None;
                        bool re = smtpcl.Authenticate();
                        if (ClientEmailAddr != "")
                        {

                            string l_email = l_msg.From;


                            mm.From = l_sender;

                            mm.To.Add(new MailAddress(ClientEmailAddr));
                            mm.Bcc.Add(new MailAddress(l_fx_alert_bcc));

                            mm.IsHtml = true;
                            string l_body = l_msg.BodyText;


                            mm.Subject = "[Alert] : " + l_msg.Subject;

                            mm.ContentEncoding = System.Text.Encoding.UTF8;
                            mm.BodyText = l_body;


                            var rs = smtpcl.SendMail(mm);

                            if (rs.SendSuccessful)
                            {
                //no sthing
                            }
Coordinator
Feb 26, 2013 at 9:36 AM
Change this line
smtpcl.AuthenticateMode = SmtpAuthenticateMode.None;
to
smtpcl.AuthenticateMode = SmtpAuthenticateMode.Auto;

and retry.I may solve your problem.

regards.
Feb 27, 2013 at 1:01 AM
After changing to SmtpAuthenticateMode.Auto, SendSuccessful still fails. Also Authenticate() returns false.
Thanks
Coordinator
Feb 27, 2013 at 9:33 AM
Hi.

What mail server do you use?
Mar 1, 2013 at 5:00 AM
Hi we are using Zambra on Linux
Coordinator
Mar 2, 2013 at 10:26 AM
Hi.

Please ensure that you can call Open method without exception?
smtpcl.Open();

If it cloudnot, it may by network problem from client to your mailserver.