简体   繁体   中英

Couldn't set-up a SMTP Server

I made a registration form using "createuserwizard" in asp.net C# and set up mailsettings like below.

 <asp:CreateUserWizard ID="userwizard" ContinueDestinationPageUrl="~/secretfiles/secret.aspx" runat="server" >
    <MailDefinition BodyFileName="register.txt" Subject="Registration Confirmation" From="amrit.enest@gmail.com" />
    </asp:CreateUserWizard>

This is my webconfig files settings:

<system.net>

    <mailSettings>
      <smtp deliveryMethod="PickupDirectoryFromIis"/>
    </mailSettings>
  </system.net>

I settled up a smtp server with following settings in ISS.

E-mail address: amrit.enest@gmail.com

Store email in pickup directory: C:\\Users\\eNest-25\\Desktop\\emails

Now when i am registering with a new user,it doesn't send emails from "amrit.enest@gmail.com" to register email id,despite it gives the following error message.

**Server Error in '/membership' Application.
Cannot get IIS pickup directory.**

just enter your host-credentials should help?

 <system.net>
    <mailSettings>
      <smtp from="amrit.enest@gmail.com">
        <network host="smtp.gmail.com" port="25" userName="yourname" password="yourpass" />
      </smtp>
    </mailSettings>
 </system.net>
<smtp deliveryMethod="SpecifiedPickupDirectory" from="amrit.enest@gmail.com">
  <specifiedPickupDirectory pickupDirectoryLocation="C:\Users\eNest-25\Desktop\emails"/>
</smtp>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM