Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • ds 191 posts 223 karma points
    Oct 04, 2011 @ 12:52
    ds
    0

    Error sending the form

    I have set up the form successfully but I am unable to send it and every time I get failureHeaderText and failureMessageText.

    I checked the configuration many times

      <system.net>
        <mailSettings>
          <smtp from="[email protected]">
            <network host="mail.xxx.com" userName="[email protected]" password="xxx" port="587" defaultCredentials="false"/>
          </smtp>
        </mailSettings>
      </system.net>
    <RVContactForm>
      <RV-ContactForm.emailTo>[email protected]</RV-ContactForm.emailTo>
      <RV-ContactForm.emailReplyFrom>[email protected]</RV-ContactForm.emailReplyFrom>
      <RV-ContactForm.enableSSL>false</RV-ContactForm.enableSSL>
    </RVContactForm>

    Do I miss something?

  • Eran 292 posts 436 karma points
    Oct 04, 2011 @ 14:57
    Eran
    0

    hi,

    are you sure you smtp settings are correct?

    to check this, if you have gmail account, try first to sent it using gmail. this is the setting that working for gmail:

     <system.net>
        <mailSettings>
          <smtp>
            <network host="smtp.gmail.com" port="587" userName="[email protected]" password="xxxxx" defaultCredentials="false" />
          </smtp>
        </mailSettings>
      </system.net>

    and in the RVContactForm.config:

    <?xml version="1.0" encoding="utf-8" ?>
    <RVContactForm>
      <RV-ContactForm.emailTo>[email protected]</RV-ContactForm.emailTo>
      <RV-ContactForm.emailReplyFrom>[email protected]</RV-ContactForm.emailReplyFrom>
      <RV-ContactForm.enableSSL>true</RV-ContactForm.enableSSL>
    </RVContactForm>

    if it also doenst work, so its something else - try to debug the RVContactForm.js using  firebug to see the request and response from the webservice.

    let me know.

    Eran

  • ds 191 posts 223 karma points
    Oct 05, 2011 @ 08:43
    ds
    0

    Hi Eran,

    Using gmail it did worked. but the mail I want to use is active and I can login with credentials by webmail and can also send mail. Where might be the problem based on the configuration on my first post?

  • Markus Johansson 1911 posts 5735 karma points MVP c-trib
    Oct 05, 2011 @ 08:51
    Markus Johansson
    0

    Are you sure that your outgoing server (smtp) is open for connections? Have you tried it in ie. Outlook?

  • Eran 292 posts 436 karma points
    Oct 05, 2011 @ 14:20
    Eran
    0

    hi, maybe this will helps you:

    this is the configuration that i'm using on other site, that uses the local smtp email to send mail. try this:

    <system.net>
    <mailSettings>
    <smtp>
    <network host="localhost" />
    </smtp>
    </mailSettings>
    </system.net>

    and the RVContactForm.config:

    <?xml version="1.0" encoding="utf-8" ?>
    <RVContactForm>
      <RV-ContactForm.emailTo>[email protected]</RV-ContactForm.emailTo>
      <RV-ContactForm.emailReplyFrom>[email protected]</RV-ContactForm.emailReplyFrom>
      <RV-ContactForm.enableSSL>false</RV-ContactForm.enableSSL>
    </RVContactForm>
  • ds 191 posts 223 karma points
    Oct 06, 2011 @ 08:01
    ds
    0

    Markus, I can send and receive mails by outlook.

    Eran, Your last suggestion did not work either. The only working configuration is using gmail. I do not understand why it does not work with my corporate mail

  • Markus Johansson 1911 posts 5735 karma points MVP c-trib
    Oct 06, 2011 @ 08:23
    Markus Johansson
    0

    Dose the ContactForm use the username and password to logon to the smtp-server? What if you try to make "your own" email usercontrol to just make sure that you can send emails using the smtpclient-class? I'm thinking that you can make sure if its you mailserver or the package that is causing the problems.

  • Markus Johansson 1911 posts 5735 karma points MVP c-trib
    Oct 06, 2011 @ 08:39
    Markus Johansson
    0

    I had a look at the source-code and i think i found the problem. No Network Credential are set on the StmpClient:

        SmtpClient mySMTPClient = new SmtpClient();
                if (enableSSL=="true")
                {
                    mySMTPClient.EnableSsl = true;
                }
                try
                {
                    mySMTPClient.Send(strEmailFrom, strEmailTo, strEmailSubject, strEmailBody);

                }
                catch (SmtpException ex)
                {
                    throw new SmtpException("error sending mail",ex);
                }

    I think that the package-creator need to add something like this:

    mySMTPClient.Credentials = new NetworkCredential("username", "password");

    Because the username and passwords set in web.config are not used by default. You may need to set them in code accourding to this posts:

    http://stackoverflow.com/questions/2766928/how-to-set-username-and-password-for-smtpclient-object-in-net

    http://stackoverflow.com/questions/4685219/smtpclient-wont-authenticate-when-inflated-from-web-config

  • Eran 292 posts 436 karma points
    Oct 08, 2011 @ 03:49
    Eran
    0

    hi markus,

    did you try to modify the code and it worked?

    did you solved it in other way?

    thanks.

    eran.

  • Victor Gunta 8 posts 74 karma points
    Nov 30, 2011 @ 15:31
    Victor Gunta
    0

    So did anyone modify the package ? I'm having the same problem, my smtp server doesn't allow relaying...

Please Sign in or register to post replies

Write your reply to:

Draft