Has anyone had luck sending email from the Sandbox? With membership functions forgot password?

Discussion in 'ASP.NET 2.0' started by CSVChicago, Aug 21, 2005.

  1. I'm working with the new Membership functions, specifically the 'forgot password' function that is supposed to send an email to the user with their password, but it's ahving trouble.

    It generates this error message:
    ============================================================
    The SMTP host was not specified.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.InvalidOperationException: The SMTP host was not specified.
    ============================================================

    I tried adding a section to the web.config that says:

    <system.web>
    <smtpMail serverName='localhost' serverPort='25' />
    <system.web>

    But then I get the standard error message that says 'You need to add a 'customerrors=off' thingy - so my guess is my attempt to override something in the machine.config is going blammo because of how the server security is setup, or I'm not entering the line correctly in the web.config?

    It does look like VWD Express Beta is flagging that line in the web.config and saying that <SmtpMail> is not a valid item in the web.config.

    Has anyone got anything to email at all form the sandbox? And if so any luck with the 'forgot password' function?

    Thanks,

    -Walter
     
  2. I too have been trying to send email from an asp.net 2.0 page without any luck (see my post regarding that). I have tried setting the MailClient.Host to "localhost", "smtpout.secureserver.net", and "smtp.comcast.net" (my local ISP), none of which work. I do not get any errors but nothing is being sent.


    If anyone knows how to make this work please post the proper steps.


    ------------
    Wayne
     
  3. Bruce

    Bruce DiscountASP.NET Staff

  4. See myreply in the "Mail Server to Use" post. I finally got it to work.


    ------------
    Wayne
     
  5. Hi All,

    We do have it working now. It turns out MS created a whole new section in the Web.Config file for this and just forgot to tell anybody about it. (well actually- 95% of the examples out there just show the old way that doesn't work anymore - you can find documentation if you know what to look for)

    Try adding this to web.config:

    <system.net>
    <mailSettings>
    <smtp deliveryMethod="Network">
    <network
    defaultCredentials="True"
    host="LocalHost"
    port="25"
    from="[email protected]"
    />
    </smtp>
    </mailSettings>
    </system.net>

    <!--handy option during testing - doesnt send emails - just writes them in a directory-->
    <!--smtp deliveryMethod="SpecifiedPickupDirectory"-->


    -Walter
     
  6. Thanks for sharing that. Very useful information. Where did you find that documented?

    Wayne


    ------------
    Wayne
     
  7. I've been on so many sites lately-- I forget where I saw that one...

    But I'm pretty sure that's when I figured out to use "BETA 2" in the Google searches and it was on a page like "What's new in Beta 2" or something like that.
     

Share This Page