Base solution for your next web application
Open Closed

Send Email Activation not working #988


User avatar
0
moustafa created

**Hello every one

i was trying to make sure that activation link sent to user after registration or from control panel by admin or throw email activation page <a class="postlink" href="http://localhost:6240/Account/EmailActivation">http://localhost:6240/Account/EmailActivation</a>

but it's not working

first of all in MyProjectCoreModule.cs i enabled email sending in debug mode IocManager.Register<IEmailSender, NullEmailSender>(DependencyLifeStyle.Transient);

and set the smtp settings and i'm very sure that its valid data but i have dobt about specific fields smtp host (no problem) smtp port (no problem) domain name (?????) username (??????) password (no problem) ssl (no problem)

but nothing works i tried for hours now so what i am missing ? can someone explains this for me ? thank you in advance**


7 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    You can leave domain empty if you don't need, but provide a user name. SmtpClient needs it.

    ABP uses simple SmtpClient for sending emails. You can see it's source code: <a class="postlink" href="https://github.com/jcachat/EntityFramework.DynamicFilters/issues/62#issuecomment-207997718">https://github.com/jcachat/EntityFramew ... -207997718</a> So, if you can send emails using .Net's standard SmtpClient, then you should be able to send in AspNet Zero.

  • User Avatar
    0
    moustafa created

    ok i left domain empty

    so what about username ?

  • User Avatar
    0
    hikalkan created
    Support Team

    If there is a user with noreply, then you can use it. But probably not. For example, for Gmail, if your email is <a href="mailto:[email protected]">[email protected]</a>, then your username is mustafa and password is your gmail login password. But I can not know it for all email providers. You can ask it to your system admin.

  • User Avatar
    0
    moustafa created

    you absolutely right so i tried with my gmail account gmail smtp : smtp.gmail.com port : 25 ssl : false username : moustafa password: ****************

    still the same problem :(

  • User Avatar
    0
    hikalkan created
    Support Team

    Gmail does not accept smtp usage unless you allow it in your account. Did you do it? Also, gmail enforces ssl and don't allow 25 port as I know. As I said before, we use .Net's standard SmtpClient. If you suspect that it's a problem with AspNet Zero, you can try plain SmtpClient. If you can send via SmtpClient, then we fix it if there is an error with ABP (but, believe me, there is no error since many people using it :))

  • User Avatar
    0
    moustafa created

    i believe you so far and i trust ASP.NET Zero and i'm sure the problem from my side not yours .. i really appreciate your concern , i'll try again and over again and i'll let you know how far i would reach

    thank you hikalkan for your support

  • User Avatar
    0
    hikalkan created
    Support Team

    No problem. Such errors mostly about configuration and mail provider. Because, AspNet Zero code is very simple in this area (if we are talking about other areas, it was different, but mailing is just a simple wrapper). So, I suggest you to be sure about your configuration. Thanks.