1

Resolved

Problem with ContactForm

description

Problem exists when we don't provide SMTP domain in CMS Configuration. Problem is in SectionControls\ContactForm.ascx.cs file - method btnSubmit_Click and these lines:
                if (_website.SmtpUser != "" && _website.SmtpPassword != "" && _website.SmtpDomain != "")
                {
                    client.UseDefaultCredentials = false;
                    client.Credentials = new NetworkCredential(_website.SmtpUser, _website.SmtpPassword, _website.SmtpDomain);
                }
problem is when we don't have domain for user account.
Solution:
 
if (_website.SmtpDomain == "")
            {
                if (_website.SmtpUser != "" && _website.SmtpPassword != "") 
                {
                    client.UseDefaultCredentials = false;
                    client.Credentials = new NetworkCredential(_website.SmtpUser, _website.SmtpPassword);
                }
            }
            else
            {
                if (_website.SmtpUser != "" && _website.SmtpPassword != "" && _website.SmtpDomain != "")
                {
                    client.UseDefaultCredentials = false;
                    client.Credentials = new NetworkCredential(_website.SmtpUser, _website.SmtpPassword, _website.SmtpDomain);
                }
            }

comments

MRAatFC wrote Jun 15, 2009 at 9:31 AM

Will be fixed with v1.3.0 (currently in beta)

Sairento wrote Dec 21, 2009 at 1:31 PM

Use an IF statement, if not all of the details are there, dont proscess this, do something else

Sairento wrote Dec 21, 2009 at 1:31 PM

Use an IF statement, if not all of the details are there, dont proscess this, do something else

wrote Feb 14, 2013 at 8:43 PM

wrote May 16, 2013 at 10:19 AM

wrote May 16, 2013 at 10:19 AM

wrote Jun 14, 2013 at 7:19 AM