[A recipient must be specified] from webmail helper RRS feed

  • Question

  • User-293841989 posted

    I'm using webmail helper to send an email, but it asks for a recipient.

    This is sendMail.cshtml: @{ WebMail.Send( to: Request["email"], subject: "Advertisement confirmation", body: message, isBodyHtml: true ); }

    This is _AppStart.cshtml: @{ WebMail.SmtpServer="smtp.gmail.com"; WebMail.From="example@gmail.com"; }

    This is web.config: 

    <?xml version="1.0"?>
            <compilation debug="false" targetFramework="4.0" />
                <smtp deliveryMethod="SpecifiedPickupDirectory">
                    <specifiedPickupDirectory pickupDirectoryLocation="C:\Mail\"/>

    Monday, May 23, 2016 2:47 AM


  • User-821857111 posted

    You need to check to see if Request["email"] contains a value. From the error message, it doesn't look like that's the case.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, May 23, 2016 6:22 AM