Request Quote Form (for 1.80 and 1.90)

9 years ago
super wrote:
thank you mb for all your help.

Now i m getting the correct file name instead of filepath.

I noticed in the webconfig that it is defined as "51200" but I still get error message when i try to attach files more than 2 mb but i am doing all these things on my local machine (because i am in development phase). May be it will work on hosting server, does that make any difference ?

This is the error message i get: "There was an error in sending your quote request. Support has been notified with your contact information" which is defined in .ascx file

Thank you again for all your help and time, you are the best !

That error message is displayed to customers when an exception occurs (when the email can't be sent, explained in this post); note that all the quote request details are inserted into the system message so the info is not lost. If you are able to submit the quote request with smaller sized attachments then the mail server you are using probably has a limit on the size of attachments and is rejecting the message when the limit is exceeded; causing the exception and error message.

.
9 years ago
Hi mb,

I tested it with another mail server and still i get error message with heavy files (like 3mb) but that's OK. My main concern  was this request quote which you already solved.

Many Thanks to you mb for your help.
9 years ago
Please vote for this item here: http://nopcommerce.codeplex.com/workitem/10024
9 years ago
Hello mb,

I have upgraded my website to 1.9v and now the requestquote pages are not working.

Please help me ?

When i add BOTH types of request quote pages that we worked on, i get these error after re-compiling:

Error  4  The type or namespace name 'RequestQuoteControl' does not exist in the namespace 'NopSolutions.NopCommerce.Web.Modules' (are you missing an assembly reference?)  

Error  5  The name 'MessageManager' does not exist in the current context  

Error  6  The name 'MessageManager' does not exist in the current context

Error  7  The name 'MessageManager' does not exist in the current context

Error  8  The name 'LogManager' does not exist in the current context

and few more errors..

plz help me with BOTH SOLUTIONS you posted above
9 years ago
bump ? plz HELP
9 years ago
The request quote form has been updated for version 1.90.

The first request quote form, updated for 1.90, can be downloaded here. (screenshot)

The second request quote form (with attachments), updated for 1.90, can be downloaded here. (screenshot)

.
9 years ago
thank you so much mb
9 years ago
I did exactly everthing as per readme file getting this error now..



Line 1:  <%@ Page Language="C#" MasterPageFile="~/MasterPages/ThreeColumn.master" AutoEventWireup="true"
Line 2:      CodeBehind="RequestQuote2.aspx.cs" Inherits="NopSolutions.NopCommerce.Web.RequestQuote2Page"%>
Line 3:  

Click here for live example

Somebody please help :(
9 years ago
hello mb,

In 1.9v website I created a 3rd request quote form in which is similar to the first request quote form, updated for 1.90

The only difference is that instead of sending it to store owner - I am sending it to 3 different recipients.

I have created settings for cc bcc - saved the correct e-mail address from administration area (in database) still the second person who is based on bcc never gets any e-mail, why ? If I put number of email address in one (bcc or cc) then store owner gets the email which means something is not working fine in the code.

This is my what I have:

The first request quote form, updated for 1.90: (Quote.ascx.cs)

using System;
using System.Collections.Generic;
using System.Net.Mail;
using System.Text;
using System.Web.UI;
using NopSolutions.NopCommerce.BusinessLogic;
using NopSolutions.NopCommerce.BusinessLogic.Audit;
using NopSolutions.NopCommerce.BusinessLogic.Configuration.Settings;
using NopSolutions.NopCommerce.BusinessLogic.Messages;
using NopSolutions.NopCommerce.Common.Utils.Html;

namespace NopSolutions.NopCommerce.Web.Modules
{
    public partial class Quote : BaseNopUserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnRequestQuote_Click(object sender, EventArgs e)
        {

            if (Page.IsValid)
            {
                try
                {

                    string emailTitle = "For Quote";
                    string fullName = txtFullName.Text.Trim();
                    string contactNumber = txtContactNumber.Text.Trim();
                    string email = txtEmail.Text.Trim();
                    string company = txtCompany.Text.Trim();
                    string companyAddress = txtCompanyAddress.Text.Trim();
                    string secondary = txtEnquiry.Text.Trim();
                    string extra = txtExtra.Text.Trim();

                    string subject = "Registration - New Member Information";

                    var body = new StringBuilder();
                    body.AppendFormat("<hr />{0} ({1})<hr />", emailTitle, DateTime.Now.ToShortDateString());
                    body.AppendFormat("<b>{0}:</b> {1}<br />", "Full Name: ", fullName);
                    body.AppendFormat("<b>{0}:</b> {1}<br />", "Company: ", company);
                    body.AppendFormat("<b>{0}:</b> {1}<br />", "Contact No. (Primary): ", contactNumber);
                    body.AppendFormat("<b>{0}:</b> {1}<br />", "Contact No. (Sec): ", secondary);
                    body.AppendFormat("<b>{0}:</b> {1}<br />", " E-mail Address: ", email);
                    body.AppendFormat("<b>{0}:</b> {1}<br />", "Products: ", companyAddress);
                    body.Append("<br />");
                    body.AppendFormat("<b>{0}:</b><br /> {1}<br />", "SecondProduct", extra.FormatContactUsFormText());
                    var from = new MailAddress(email, fullName);
                    var emailAccount = this.MessageService.DefaultEmailAccount;

                    string body2 = body.ToString();

                    //required for some SMTP servers
                    if (SettingManager.GetSettingValueBoolean("Email.UseSystemEmailForContactUsForm"))
                    {
                        from = new MailAddress(emailAccount.Email, emailAccount.DisplayName);
                        body2 = string.Format("<b>From</b>: {0} - {1} <br /><br />{2} ", Server.HtmlEncode(fullName), Server.HtmlEncode(email), body2);
                    }

                    var to = new MailAddress(emailAccount.Email, emailAccount.DisplayName);
                    // if set, allows message to be sent to recipient (email address) other than default email account
                    string toEmail = SettingManager.GetSettingValue("RecipientFirst.ToEmail", String.Empty).Trim();
                    if (string.IsNullOrEmpty(toEmail) == false)
                    {
                        try
                        {
                            to = new MailAddress(toEmail);
                        }
                        catch (Exception)
                        { }
                    }
                    string ccEmails = SettingManager.GetSettingValue("RecipientThird.ccEmails", String.Empty);
                    string bccEmails = SettingManager.GetSettingValue("RecipientSecond.bccEmails", String.Empty);

                    List<string> bcc = new List<string>();
                    foreach (string str1 in bccEmails.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
                    {
                        bcc.Add(str1);
                    }
                    List<string> cc = new List<string>();
                    foreach (string str1 in ccEmails.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
                    {
                        cc.Add(str1);
                    }

                    this.MessageService.InsertQueuedEmail(5, from, to, ccEmails, bccEmails, subject, body2,
                        DateTime.UtcNow, 0, null, emailAccount.EmailAccountId);

                    pnlResult.Visible = true;
                    pnlRequestQuote.Visible = false;
                }
                catch (Exception exc)
                {
                    this.LogService.InsertLog(LogTypeEnum.MailError, string.Format("Error sending \"Quote\" email."), exc);
                }
            }
        }
    }
}

---------------------------IN MY ALL SETTINGS------------

RecipientFirst.ToEmail :   [email protected]     
RecipientSecond.bccEmails: [email protected]; [email protected]   
RecipientThird.ccEmails  :     [email protected]
9 years ago
Hi mb

Please help me with this error..

I did exactly everthing as per readme file getting this error now..



Line 1:  <%@ Page Language="C#" MasterPageFile="~/MasterPages/ThreeColumn.master" AutoEventWireup="true"
Line 2:      CodeBehind="RequestQuote2.aspx.cs" Inherits="NopSolutions.NopCommerce.Web.RequestQuote2Page"%>
Line 3:  

Click here for live example
Somebody please help :(