This project is read-only.

SMTP cannot send email

Feb 25, 2013 at 8:50 AM
Edited Feb 26, 2013 at 2: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
                            }
Feb 26, 2013 at 10: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 2:01 AM
After changing to SmtpAuthenticateMode.Auto, SendSuccessful still fails. Also Authenticate() returns false.
Thanks
Feb 27, 2013 at 10:33 AM
Hi.

What mail server do you use?
Mar 1, 2013 at 6:00 AM
Hi we are using Zambra on Linux
Mar 2, 2013 at 11: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.